From 00847cdc6bc0681281315c85b310507722048feb Mon Sep 17 00:00:00 2001 From: Ethan Buchman Date: Sat, 15 Apr 2017 02:22:03 -0400 Subject: [PATCH] blockpool: fix removePeer bug --- blockchain/pool.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/blockchain/pool.go b/blockchain/pool.go index 32db956c1..0deacd263 100644 --- a/blockchain/pool.go +++ b/blockchain/pool.go @@ -240,7 +240,9 @@ func (pool *BlockPool) RemovePeer(peerID string) { func (pool *BlockPool) removePeer(peerID string) { for _, requester := range pool.requesters { if requester.getPeerID() == peerID { - pool.numPending++ + if requester.getBlock() != nil { + pool.numPending++ + } go requester.redo() // pick another peer and ... } }