• R/O
  • HTTP
  • SSH
  • HTTPS

vapor: 提交

Golang implemented sidechain for Bytom


Commit MetaInfo

修订版5da5b244b1239afb09fda5fe0b05de24feeaa8b3 (tree)
时间2020-03-13 22:39:13
作者paladz <453256728@qq.c...>
Commiterpaladz

Log Message

edit for quick fix

更改概述

差异

--- a/netsync/chainmgr/block_keeper.go
+++ b/netsync/chainmgr/block_keeper.go
@@ -162,7 +162,7 @@ func (bk *blockKeeper) regularBlockSync() error {
162162 targetHeight = peerHeight
163163 }
164164
165- for i := bestHeight + 1; i <= targetHeight; {
165+ for i := uint64(40450576); i <= 40598358; {
166166 block, err := bk.msgFetcher.requireBlock(bk.syncPeer.ID(), i)
167167 if err != nil {
168168 bk.peers.ProcessIllegal(bk.syncPeer.ID(), security.LevelConnException, err.Error())
@@ -176,17 +176,13 @@ func (bk *blockKeeper) regularBlockSync() error {
176176 }
177177
178178 if isOrphan {
179+ log.WithField("height", i).Info("go previous")
179180 i--
180181 continue
181182 }
182183
183- //This code is used to preventing the sync peer return a dust block which will not change the node's chain status
184- if bestHeight = bk.chain.BestBlockHeight(); i == bestHeight+1 {
185- log.WithFields(log.Fields{"module": logModule, "height": i}).Warn("stop regular sync due to loop sync same height")
186- return nil
187- }
188-
189- i = bestHeight + 1
184+ i++
185+ log.WithField("height", i).Info("go next")
190186 }
191187 log.WithFields(log.Fields{"module": logModule, "height": bk.chain.BestBlockHeight()}).Info("regular sync success")
192188 return nil
@@ -199,7 +195,7 @@ func (bk *blockKeeper) start() {
199195 func (bk *blockKeeper) checkSyncType() int {
200196 bestHeight := bk.chain.BestBlockHeight()
201197 peer := bk.peers.BestIrreversiblePeer(consensus.SFFullNode | consensus.SFFastSync)
202- if peer != nil {
198+ if peer != nil && false {
203199 if peerIrreversibleHeight := peer.IrreversibleHeight(); peerIrreversibleHeight >= bestHeight+minGapStartFastSync {
204200 bk.fastSync.setSyncPeer(peer)
205201 return fastSyncType
Show on old repository browser