aboutsummaryrefslogtreecommitdiffstats
path: root/eth/downloader/downloader_test.go
diff options
context:
space:
mode:
authorPéter Szilágyi <peterke@gmail.com>2018-02-11 20:43:56 +0800
committerPéter Szilágyi <peterke@gmail.com>2018-02-11 20:43:56 +0800
commit96dad6b6f6f8db88cca7496665016152272881cb (patch)
treea02a59b5a41c13c50d6280915978cdf3084f53a9 /eth/downloader/downloader_test.go
parent5cf75a30c1ceb0ab35cd6b0532520d556996b21c (diff)
downloaddexon-96dad6b6f6f8db88cca7496665016152272881cb.tar
dexon-96dad6b6f6f8db88cca7496665016152272881cb.tar.gz
dexon-96dad6b6f6f8db88cca7496665016152272881cb.tar.bz2
dexon-96dad6b6f6f8db88cca7496665016152272881cb.tar.lz
dexon-96dad6b6f6f8db88cca7496665016152272881cb.tar.xz
dexon-96dad6b6f6f8db88cca7496665016152272881cb.tar.zst
dexon-96dad6b6f6f8db88cca7496665016152272881cb.zip
eth/downloader: don't require state for ancestor lookups
Diffstat (limited to 'eth/downloader/downloader_test.go')
-rw-r--r--eth/downloader/downloader_test.go11
1 files changed, 3 insertions, 8 deletions
diff --git a/eth/downloader/downloader_test.go b/eth/downloader/downloader_test.go
index d94d55f11..cb671a7df 100644
--- a/eth/downloader/downloader_test.go
+++ b/eth/downloader/downloader_test.go
@@ -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.