diff options
author | Jeffrey Wilcke <jeffrey@ethereum.org> | 2016-06-13 21:16:09 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2016-06-13 21:16:09 +0800 |
commit | a38be3eb488a349693a9c9905ab015278281f8db (patch) | |
tree | 34fa99ba38f421d9c7ffd308ed544cd5053df228 /tests/block_test_util.go | |
parent | 73c028c40a4f1336a0ab4b9773be0a9d7719777f (diff) | |
parent | f9917c8c7b6d16daadebd72977e56a8adc0382b0 (diff) | |
download | go-tangerine-a38be3eb488a349693a9c9905ab015278281f8db.tar go-tangerine-a38be3eb488a349693a9c9905ab015278281f8db.tar.gz go-tangerine-a38be3eb488a349693a9c9905ab015278281f8db.tar.bz2 go-tangerine-a38be3eb488a349693a9c9905ab015278281f8db.tar.lz go-tangerine-a38be3eb488a349693a9c9905ab015278281f8db.tar.xz go-tangerine-a38be3eb488a349693a9c9905ab015278281f8db.tar.zst go-tangerine-a38be3eb488a349693a9c9905ab015278281f8db.zip |
Merge pull request #2455 from zsfelfoldi/chaindb
core: improved chain db performance by using sequential keys
Diffstat (limited to 'tests/block_test_util.go')
-rw-r--r-- | tests/block_test_util.go | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/tests/block_test_util.go b/tests/block_test_util.go index b92c183e1..d9a5eec08 100644 --- a/tests/block_test_util.go +++ b/tests/block_test_util.go @@ -164,7 +164,7 @@ func runBlockTest(homesteadBlock *big.Int, test *BlockTest) error { return fmt.Errorf("InsertPreState: %v", err) } - core.WriteTd(db, test.Genesis.Hash(), test.Genesis.Difficulty()) + core.WriteTd(db, test.Genesis.Hash(), 0, test.Genesis.Difficulty()) core.WriteBlock(db, test.Genesis) core.WriteCanonicalHash(db, test.Genesis.Hash(), test.Genesis.NumberU64()) core.WriteHeadBlockHash(db, test.Genesis.Hash()) @@ -412,7 +412,7 @@ func (test *BlockTest) ValidateImportedHeaders(cm *core.BlockChain, validBlocks // block-by-block, so we can only validate imported headers after // all blocks have been processed by ChainManager, as they may not // be part of the longest chain until last block is imported. - for b := cm.CurrentBlock(); b != nil && b.NumberU64() != 0; b = cm.GetBlock(b.Header().ParentHash) { + for b := cm.CurrentBlock(); b != nil && b.NumberU64() != 0; b = cm.GetBlockByHash(b.Header().ParentHash) { bHash := common.Bytes2Hex(b.Hash().Bytes()) // hex without 0x prefix if err := validateHeader(bmap[bHash].BlockHeader, b.Header()); err != nil { return fmt.Errorf("Imported block header validation failed: %v", err) |