Browse Source

Fix peer memleak; stop goroutine when peer is offline

pull/307/head
Jae Kwon 8 years ago
parent
commit
a9d8039082
2 changed files with 2 additions and 1 deletions
  1. +1
    -0
      consensus/state.go
  2. +1
    -1
      mempool/reactor.go

+ 1
- 0
consensus/state.go 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
}


+ 1
- 1
mempool/reactor.go 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 {


Loading…
Cancel
Save