diff options
author | Wenbiao Zheng <delweng@gmail.com> | 2018-09-03 23:33:21 +0800 |
---|---|---|
committer | Felix Lange <fjl@users.noreply.github.com> | 2018-09-03 23:33:21 +0800 |
commit | 6a33954731658667056466bf7573ed1c397f4750 (patch) | |
tree | d61c7672f1b0f451587efce656b94db3e187c4cc /core/blockchain.go | |
parent | 6fc84946203929143c51010e0a10d9fa61fb9b92 (diff) | |
download | dexon-6a33954731658667056466bf7573ed1c397f4750.tar.gz dexon-6a33954731658667056466bf7573ed1c397f4750.tar.zst dexon-6a33954731658667056466bf7573ed1c397f4750.zip |
core, eth, trie: use common/prque (#17508)
Diffstat (limited to 'core/blockchain.go')
-rw-r--r-- | core/blockchain.go | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/core/blockchain.go b/core/blockchain.go index 0461da7fd..63f60ca28 100644 --- a/core/blockchain.go +++ b/core/blockchain.go @@ -29,6 +29,7 @@ import ( "github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/common/mclock" + "github.com/ethereum/go-ethereum/common/prque" "github.com/ethereum/go-ethereum/consensus" "github.com/ethereum/go-ethereum/core/rawdb" "github.com/ethereum/go-ethereum/core/state" @@ -43,7 +44,6 @@ import ( "github.com/ethereum/go-ethereum/rlp" "github.com/ethereum/go-ethereum/trie" "github.com/hashicorp/golang-lru" - "gopkg.in/karalabe/cookiejar.v2/collections/prque" ) var ( @@ -151,7 +151,7 @@ func NewBlockChain(db ethdb.Database, cacheConfig *CacheConfig, chainConfig *par chainConfig: chainConfig, cacheConfig: cacheConfig, db: db, - triegc: prque.New(), + triegc: prque.New(nil), stateCache: state.NewDatabase(db), quit: make(chan struct{}), bodyCache: bodyCache, @@ -915,7 +915,7 @@ func (bc *BlockChain) WriteBlockWithState(block *types.Block, receipts []*types. } else { // Full but not archive node, do proper garbage collection triedb.Reference(root, common.Hash{}) // metadata reference to keep trie alive - bc.triegc.Push(root, -float32(block.NumberU64())) + bc.triegc.Push(root, -int64(block.NumberU64())) if current := block.NumberU64(); current > triesInMemory { // If we exceeded our memory allowance, flush matured singleton nodes to disk |