aboutsummaryrefslogtreecommitdiffstats
path: root/eth/fetcher
diff options
context:
space:
mode:
authorWenbiao Zheng <delweng@gmail.com>2018-09-03 23:33:21 +0800
committerFelix Lange <fjl@users.noreply.github.com>2018-09-03 23:33:21 +0800
commit6a33954731658667056466bf7573ed1c397f4750 (patch)
treed61c7672f1b0f451587efce656b94db3e187c4cc /eth/fetcher
parent6fc84946203929143c51010e0a10d9fa61fb9b92 (diff)
downloaddexon-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.go8
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)
}