• R/O
  • HTTP
  • SSH
  • HTTPS

vapor: 提交

Golang implemented sidechain for Bytom


Commit MetaInfo

修订版d36e2a6e1139023e476b87c028e75824e191497a (tree)
时间2019-11-27 18:44:53
作者paladz <453256728@qq.c...>
Commiterpaladz

Log Message

try fix

更改概述

差异

--- a/netsync/chainmgr/block_keeper.go
+++ b/netsync/chainmgr/block_keeper.go
@@ -182,11 +182,8 @@ func (bk *blockKeeper) regularBlockSync() error {
182182
183183 //This code is used to preventing the sync peer return a dust block which will not change the node's chain status
184184 if bestHeight = bk.chain.BestBlockHeight(); i == bestHeight+1 {
185- blockHash := block.Hash()
186- if _, err := bk.chain.GetHeaderByHash(&blockHash); err != nil {
187- i--
188- continue
189- }
185+ log.WithFields(log.Fields{"module": logModule, "height": i}).Warn("stop regular sync due to loop sync same height")
186+ return nil
190187 }
191188
192189 i = bestHeight + 1
--- a/netsync/chainmgr/fast_sync.go
+++ b/netsync/chainmgr/fast_sync.go
@@ -152,7 +152,7 @@ func (fs *fastSync) process() error {
152152 // sync length cannot be greater than maxFastSyncBlocksNum.
153153 func (fs *fastSync) findSyncRange() (*types.Block, error) {
154154 bestHeight := fs.chain.BestBlockHeight()
155- length := fs.mainSyncPeer.IrreversibleHeight() - fastSyncPivotGap - bestHeight
155+ length := fs.mainSyncPeer.Height() - fastSyncPivotGap - bestHeight
156156 if length > maxNumOfBlocksPerSync {
157157 length = maxNumOfBlocksPerSync
158158 }
Show on old repository browser