diff options
author | zsfelfoldi <zsfelfoldi@gmail.com> | 2015-12-16 11:26:23 +0800 |
---|---|---|
committer | zsfelfoldi <zsfelfoldi@gmail.com> | 2016-03-10 21:57:32 +0800 |
commit | 73d21ea6afad5b2a89c1aa6e3d8aa0a0fc002c00 (patch) | |
tree | 6109fe60cfde0b20f8d1608026d9a2805278c1e9 /core/blockchain_test.go | |
parent | bff9ceb6b88021c1ba5bc02a56ec88c275e62e76 (diff) | |
download | go-tangerine-73d21ea6afad5b2a89c1aa6e3d8aa0a0fc002c00.tar.gz go-tangerine-73d21ea6afad5b2a89c1aa6e3d8aa0a0fc002c00.tar.zst go-tangerine-73d21ea6afad5b2a89c1aa6e3d8aa0a0fc002c00.zip |
core: create a header chain structure shared by core.BlockChain and light.LightChain
Diffstat (limited to 'core/blockchain_test.go')
-rw-r--r-- | core/blockchain_test.go | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/core/blockchain_test.go b/core/blockchain_test.go index a7d3ea56e..310751cca 100644 --- a/core/blockchain_test.go +++ b/core/blockchain_test.go @@ -472,11 +472,16 @@ func makeBlockChainWithDiff(genesis *types.Block, d []int, seed byte) []*types.B func chm(genesis *types.Block, db ethdb.Database) *BlockChain { var eventMux event.TypeMux - bc := &BlockChain{chainDb: db, genesisBlock: genesis, eventMux: &eventMux, pow: FakePow{}, rand: rand.New(rand.NewSource(0))} - bc.headerCache, _ = lru.New(100) + bc := &BlockChain{ + chainDb: db, + genesisBlock: genesis, + eventMux: &eventMux, + pow: FakePow{}, + } + valFn := func() HeaderValidator { return bc.Validator() } + bc.hc, _ = NewHeaderChain(db, valFn, bc.getProcInterrupt) bc.bodyCache, _ = lru.New(100) bc.bodyRLPCache, _ = lru.New(100) - bc.tdCache, _ = lru.New(100) bc.blockCache, _ = lru.New(100) bc.futureBlocks, _ = lru.New(100) bc.SetValidator(bproc{}) |