Skip to content

Commit c45174d

Browse files
authored
Merge pull request #194 from yoursunny/svs3data
sync: ensure State Vector Data Name follows SVS v3 spec
2 parents 362a010 + d83b6eb commit c45174d

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

std/sync/svs.go

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@ import (
1717
"github.com/named-data/ndnd/std/utils"
1818
)
1919

20+
const SvSyncVersion = 3
21+
2022
type SvSync struct {
2123
o SvSyncOpts
2224

@@ -135,7 +137,7 @@ func NewSvSync(opts SvSyncOpts) *SvSync {
135137
mutex: sync.Mutex{},
136138
state: initialState,
137139
mtime: make(map[string]time.Time),
138-
prefix: opts.GroupPrefix.Append(enc.NewVersionComponent(3)),
140+
prefix: opts.GroupPrefix.Append(enc.NewVersionComponent(SvSyncVersion)),
139141

140142
suppress: false,
141143
merge: NewSvMap[uint64](0),
@@ -480,7 +482,7 @@ func (s *SvSync) encodeSyncData() enc.Wire {
480482
svWire := (&spec_svs.SvsData{StateVector: sv}).Encode()
481483

482484
// SVS v3 Sync Data
483-
name := s.o.SyncDataName.WithVersion(enc.VersionUnixMicro)
485+
name := s.o.SyncDataName.WithVersion(SvSyncVersion)
484486

485487
// Sign Sync Data
486488
signer := s.o.Client.SuggestSigner(name)

0 commit comments

Comments
 (0)