eth/downloader: don't require state for ancestor lookups

This commit is contained in:
Péter Szilágyi
2018-02-11 14:43:56 +02:00
parent 5cf75a30c1
commit 96dad6b6f6
2 changed files with 9 additions and 13 deletions

View File

@ -221,14 +221,9 @@ func (dl *downloadTester) HasHeader(hash common.Hash, number uint64) bool {
return dl.GetHeaderByHash(hash) != nil
}
// HasBlockAndState checks if a block and associated state is present in the testers canonical chain.
func (dl *downloadTester) HasBlockAndState(hash common.Hash, number uint64) bool {
block := dl.GetBlockByHash(hash)
if block == nil {
return false
}
_, err := dl.stateDb.Get(block.Root().Bytes())
return err == nil
// HasBlock checks if a block is present in the testers canonical chain.
func (dl *downloadTester) HasBlock(hash common.Hash, number uint64) bool {
return dl.GetBlockByHash(hash) != nil
}
// GetHeader retrieves a header from the testers canonical chain.