Fix peer memleak; stop goroutine when peer is offline

This commit is contained in:
Jae Kwon 2016-10-17 11:29:43 -07:00
parent 2113b6f4bb
commit a9d8039082
2 changed files with 2 additions and 1 deletions

View File

@ -1196,6 +1196,7 @@ func (cs *ConsensusState) tryFinalizeCommit(height int) {
}
if !cs.ProposalBlock.HashesTo(hash) {
// TODO: this happens every time if we're not a validator (ugly logs)
// TODO: ^^ wait, why does it matter that we're a validator?
log.Warn("Attempt to finalize failed. We don't have the commit block.")
return
}

View File

@ -109,7 +109,7 @@ func (memR *MempoolReactor) broadcastTxRoutine(peer Peer) {
var next *clist.CElement
for {
if !memR.IsRunning() {
if !memR.IsRunning() || !peer.IsRunning() {
return // Quit!
}
if next == nil {