mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-07-25 06:06:44 +00:00
flow control deadlock fix
This commit is contained in:
parent
c48b7caf6a
commit
64b136b996
2 changed files with 2 additions and 2 deletions
|
|
@ -190,8 +190,8 @@ func (self *ClientManager) accept(node *cmNode, time int64) bool {
|
|||
self.update(time)
|
||||
if !self.canStartReq() {
|
||||
resume := make(chan bool)
|
||||
self.resumeQueue <- resume
|
||||
self.lock.Unlock()
|
||||
self.resumeQueue <- resume
|
||||
<-resume
|
||||
self.lock.Lock()
|
||||
if _, ok := self.nodes[node]; !ok {
|
||||
|
|
|
|||
|
|
@ -67,7 +67,7 @@ func (ps *odrPeerSet) unregister(p *peer) error {
|
|||
|
||||
func (ps *odrPeerSet) peerPriority(p *peer, info *odrPeerInfo, req LesOdrRequest) uint64 {
|
||||
tm := p.fcServer.CanSend(req.GetCost(p))
|
||||
if info.reqCnt > 0 {
|
||||
if info.reqTimeCnt > 0 {
|
||||
tm += info.reqTimeSum / info.reqTimeCnt
|
||||
}
|
||||
return tm
|
||||
|
|
|
|||
Loading…
Reference in a new issue