eth: fix sync bloom panic (#19757)

* eth: fix sync bloom panic

* eth: delete useless test cases
This commit is contained in:
gary rong
2019-06-26 16:00:21 +08:00
committed by Péter Szilágyi
parent 54fd263b40
commit fd072c2fd1
3 changed files with 22 additions and 16 deletions

View File

@ -179,14 +179,6 @@ func (pm *ProtocolManager) synchronise(peer *peer) {
if atomic.LoadUint32(&pm.fastSync) == 1 {
// Fast sync was explicitly requested, and explicitly granted
mode = downloader.FastSync
} else if currentBlock.NumberU64() == 0 && pm.blockchain.CurrentFastBlock().NumberU64() > 0 {
// The database seems empty as the current block is the genesis. Yet the fast
// block is ahead, so fast sync was enabled for this node at a certain point.
// The only scenario where this can happen is if the user manually (or via a
// bad block) rolled back a fast sync node below the sync point. In this case
// however it's safe to reenable fast sync.
atomic.StoreUint32(&pm.fastSync, 1)
mode = downloader.FastSync
}
if mode == downloader.FastSync {
// Make sure the peer's total difficulty we are synchronizing is higher.