Browse Source

fix pool timer leak bug, resolve#3353 (#3358)

When remove peer, block pool simple remove bpPeer,
but do not stop timer, that cause stopError for recorrected
peers. Stop timer when remove from pool.
pull/3374/head
zjubfd 6 years ago
committed by Ethan Buchman
parent
commit
976b1c2ef7
1 changed files with 3 additions and 0 deletions
  1. +3
    -0
      blockchain/pool.go

+ 3
- 0
blockchain/pool.go View File

@ -299,6 +299,9 @@ func (pool *BlockPool) removePeer(peerID p2p.ID) {
requester.redo(peerID)
}
}
if p, exist := pool.peers[peerID]; exist && p.timeout != nil {
p.timeout.Stop()
}
delete(pool.peers, peerID)
}


Loading…
Cancel
Save