core, eth: roll back uncertain headers in failed fast syncs

This commit is contained in:
Péter Szilágyi
2015-10-09 16:21:47 +03:00
parent b97e34a8e4
commit a9d8dfc8e7
6 changed files with 180 additions and 15 deletions

View File

@ -60,6 +60,9 @@ type blockChainInsertFn func(types.Blocks) (int, error)
// receiptChainInsertFn is a callback type to insert a batch of receipts into the local chain.
type receiptChainInsertFn func(types.Blocks, []types.Receipts) (int, error)
// chainRollbackFn is a callback type to remove a few recently added elements from the local chain.
type chainRollbackFn func([]common.Hash)
// peerDropFn is a callback type for dropping a peer detected as malicious.
type peerDropFn func(id string)