mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-08-20 10:52:25 +00:00
les: fixed clientPool.setLimits
This commit is contained in:
parent
c5d958e205
commit
e5163d1e05
1 changed files with 8 additions and 6 deletions
|
|
@ -366,6 +366,7 @@ func (f *clientPool) setLimits(count int, totalCap uint64) {
|
|||
|
||||
f.countLimit = count
|
||||
f.capacityLimit = totalCap
|
||||
if f.connectedCapacity > f.capacityLimit || f.connectedQueue.Size() > f.countLimit {
|
||||
now := mclock.Now()
|
||||
f.connectedQueue.MultiPop(func(data interface{}, priority int64) bool {
|
||||
c := data.(*clientInfo)
|
||||
|
|
@ -373,6 +374,7 @@ func (f *clientPool) setLimits(count int, totalCap uint64) {
|
|||
return f.connectedCapacity > f.capacityLimit || f.connectedQueue.Size() > f.countLimit
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
// requestCost feeds request cost after serving a request from the given peer.
|
||||
func (f *clientPool) requestCost(p *peer, cost uint64) {
|
||||
|
|
|
|||
Loading…
Reference in a new issue