From a4001a92deb868d3bd924bc69a9187da199ec25d Mon Sep 17 00:00:00 2001 From: Jacky Wang Date: Thu, 25 Mar 2021 05:52:18 -0700 Subject: [PATCH] [sync] fix two bugs --- api/service/legacysync/syncing.go | 2 +- node/node_syncing.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/api/service/legacysync/syncing.go b/api/service/legacysync/syncing.go index a16ef918a..8fe86b501 100644 --- a/api/service/legacysync/syncing.go +++ b/api/service/legacysync/syncing.go @@ -593,7 +593,7 @@ func (ss *StateSync) downloadBlocks(bc *core.BlockChain) { if count > downloadBlocksRetryLimit { break } - if err := ss.stateSyncTaskQueue.Put(failedTasks); err != nil { + if err := taskQueue.put(failedTasks); err != nil { utils.Logger().Warn(). Err(err). Interface("taskIndexes", failedTasks.indexes()). diff --git a/node/node_syncing.go b/node/node_syncing.go index 89afcbe66..0f767c88f 100644 --- a/node/node_syncing.go +++ b/node/node_syncing.go @@ -605,7 +605,7 @@ func (node *Node) getEncodedBlockWithSigByHash(hash common.Hash) ([]byte, error) func (node *Node) getCommitSigAndBitmap(block *types.Block) ([]byte, error) { child := node.Blockchain().GetBlockByNumber(block.NumberU64() + 1) - if child == nil { + if child != nil { return node.getCommitSigFromChild(block, child) } return node.getCommitSigFromDB(block)