diff options
Diffstat (limited to 'swarm/network/syncer.go')
-rw-r--r-- | swarm/network/syncer.go | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/swarm/network/syncer.go b/swarm/network/syncer.go index a3814e423..6d729fcb9 100644 --- a/swarm/network/syncer.go +++ b/swarm/network/syncer.go @@ -131,9 +131,8 @@ type SyncParams struct { } // constructor with default values -func NewSyncParams(bzzdir string) *SyncParams { +func NewDefaultSyncParams() *SyncParams { return &SyncParams{ - RequestDbPath: filepath.Join(bzzdir, "requests"), RequestDbBatchSize: requestDbBatchSize, KeyBufferSize: keyBufferSize, SyncBufferSize: syncBufferSize, @@ -144,6 +143,12 @@ func NewSyncParams(bzzdir string) *SyncParams { } } +//this can only finally be set after all config options (file, cmd line, env vars) +//have been evaluated +func (self *SyncParams) Init(path string) { + self.RequestDbPath = filepath.Join(path, "requests") +} + // syncer is the agent that manages content distribution/storage replication/chunk storeRequest forwarding type syncer struct { *SyncParams // sync parameters @@ -378,7 +383,7 @@ func (self *syncer) syncHistory(state *syncState) chan interface{} { } select { // blocking until history channel is read from - case history <- storage.Key(key): + case history <- key: n++ log.Trace(fmt.Sprintf("syncer[%v]: history: %v (%v keys)", self.key.Log(), key.Log(), n)) state.Latest = key |