Fix sync bug

pull/1921/head
Rongjian Lan 5 years ago
parent c69ba303a0
commit 738134a7da
  1. 5
      api/service/syncing/syncing.go

@ -536,9 +536,10 @@ func (ss *StateSync) getBlockFromLastMileBlocksByParentHash(parentHash common.Ha
// UpdateBlockAndStatus ...
func (ss *StateSync) UpdateBlockAndStatus(block *types.Block, bc *core.BlockChain, worker *worker.Worker, verifyAllSig bool) error {
utils.Logger().Info().Str("blockHex", bc.CurrentBlock().Hash().Hex()).Msg("[SYNC] UpdateBlockAndStatus: Current Block")
utils.Logger().Info().Str("blockHex", bc.CurrentBlock().Hash().Hex()).Uint64("blockNum", block.NumberU64()).Msg("[SYNC] UpdateBlockAndStatus: Current Block")
if block.NumberU64() >= bc.CurrentHeader().Number().Uint64() {
if block.NumberU64() != bc.CurrentHeader().Number().Uint64()+1 {
utils.Logger().Info().Uint64("curBlockNum", bc.CurrentHeader().Number().Uint64()).Uint64("receivedBlockNum", block.NumberU64()).Msg("[SYNC] Inappropriate block number, ignore!")
return nil
}

Loading…
Cancel
Save