OSDN Git Service

try to fix network issue (#456)
authorPaladz <yzhu101@uottawa.ca>
Wed, 27 Nov 2019 10:39:28 +0000 (18:39 +0800)
committerGitHub <noreply@github.com>
Wed, 27 Nov 2019 10:39:28 +0000 (18:39 +0800)
* try to fix network issue

* try fix bug

* try fix

netsync/chainmgr/fast_sync.go

index 5565987..f9e3fb6 100644 (file)
@@ -152,7 +152,7 @@ func (fs *fastSync) process() error {
 // sync length cannot be greater than maxFastSyncBlocksNum.
 func (fs *fastSync) findSyncRange() (*types.Block, error) {
        bestHeight := fs.chain.BestBlockHeight()
-       length := fs.mainSyncPeer.IrreversibleHeight() - fastSyncPivotGap - bestHeight
+       length := fs.mainSyncPeer.Height() - fastSyncPivotGap - bestHeight
        if length > maxNumOfBlocksPerSync {
                length = maxNumOfBlocksPerSync
        }