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 /eth/fetcher | |
parent | 6fc84946203929143c51010e0a10d9fa61fb9b92 (diff) | |
download | dexon-6a33954731658667056466bf7573ed1c397f4750.tar dexon-6a33954731658667056466bf7573ed1c397f4750.tar.gz dexon-6a33954731658667056466bf7573ed1c397f4750.tar.bz2 dexon-6a33954731658667056466bf7573ed1c397f4750.tar.lz dexon-6a33954731658667056466bf7573ed1c397f4750.tar.xz dexon-6a33954731658667056466bf7573ed1c397f4750.tar.zst dexon-6a33954731658667056466bf7573ed1c397f4750.zip |
core, eth, trie: use common/prque (#17508)
Diffstat (limited to 'eth/fetcher')
-rw-r--r-- | eth/fetcher/fetcher.go | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/eth/fetcher/fetcher.go b/eth/fetcher/fetcher.go index 277f14b81..f0b5e8064 100644 --- a/eth/fetcher/fetcher.go +++ b/eth/fetcher/fetcher.go @@ -23,10 +23,10 @@ import ( "time" "github.com/ethereum/go-ethereum/common" + "github.com/ethereum/go-ethereum/common/prque" "github.com/ethereum/go-ethereum/consensus" "github.com/ethereum/go-ethereum/core/types" "github.com/ethereum/go-ethereum/log" - "gopkg.in/karalabe/cookiejar.v2/collections/prque" ) const ( @@ -160,7 +160,7 @@ func New(getBlock blockRetrievalFn, verifyHeader headerVerifierFn, broadcastBloc fetching: make(map[common.Hash]*announce), fetched: make(map[common.Hash][]*announce), completing: make(map[common.Hash]*announce), - queue: prque.New(), + queue: prque.New(nil), queues: make(map[string]int), queued: make(map[common.Hash]*inject), getBlock: getBlock, @@ -299,7 +299,7 @@ func (f *Fetcher) loop() { // If too high up the chain or phase, continue later number := op.block.NumberU64() if number > height+1 { - f.queue.Push(op, -float32(number)) + f.queue.Push(op, -int64(number)) if f.queueChangeHook != nil { f.queueChangeHook(hash, true) } @@ -624,7 +624,7 @@ func (f *Fetcher) enqueue(peer string, block *types.Block) { } f.queues[peer] = count f.queued[hash] = op - f.queue.Push(op, -float32(block.NumberU64())) + f.queue.Push(op, -int64(block.NumberU64())) if f.queueChangeHook != nil { f.queueChangeHook(op.block.Hash(), true) } |