diff options
author | Janoš Guljaš <janos@users.noreply.github.com> | 2019-04-30 15:28:46 +0800 |
---|---|---|
committer | Anton Evangelatov <anton.evangelatov@gmail.com> | 2019-05-10 18:26:49 +0800 |
commit | 3030893a21b17a0e90ddd0047d0f310fee8335a0 (patch) | |
tree | b290c8ea5f7463a9a50ac57646610999f46c6163 /swarm/network/stream/syncer.go | |
parent | 12240baf61e251a80e3759dd22ca5847dcb8d807 (diff) | |
download | go-tangerine-3030893a21b17a0e90ddd0047d0f310fee8335a0.tar go-tangerine-3030893a21b17a0e90ddd0047d0f310fee8335a0.tar.gz go-tangerine-3030893a21b17a0e90ddd0047d0f310fee8335a0.tar.bz2 go-tangerine-3030893a21b17a0e90ddd0047d0f310fee8335a0.tar.lz go-tangerine-3030893a21b17a0e90ddd0047d0f310fee8335a0.tar.xz go-tangerine-3030893a21b17a0e90ddd0047d0f310fee8335a0.tar.zst go-tangerine-3030893a21b17a0e90ddd0047d0f310fee8335a0.zip |
swarm/network: update syncing
Diffstat (limited to 'swarm/network/stream/syncer.go')
-rw-r--r-- | swarm/network/stream/syncer.go | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/swarm/network/stream/syncer.go b/swarm/network/stream/syncer.go index 79b04a307..043192903 100644 --- a/swarm/network/stream/syncer.go +++ b/swarm/network/stream/syncer.go @@ -88,6 +88,11 @@ func (s *SwarmSyncerServer) SessionIndex() (uint64, error) { // are added in batchTimeout period, the batch will be returned. This function // will block until new chunks are received from localstore pull subscription. func (s *SwarmSyncerServer) SetNextBatch(from, to uint64) ([]byte, uint64, uint64, *HandoverProof, error) { + //TODO: maybe add unit test for intervals usage in netstore/localstore together with SwarmSyncerServer? + if from > 0 { + from-- + } + descriptors, stop := s.netStore.SubscribePull(context.Background(), s.po, from, to) defer stop() |