Browse Source

check peerMempoolChan for nil on Reset

pull/164/head
Ethan Buchman 9 years ago
committed by Jae Kwon
parent
commit
df9ef1e733
1 changed files with 6 additions and 1 deletions
  1. +6
    -1
      mempool/reactor.go

+ 6
- 1
mempool/reactor.go View File

@ -97,7 +97,12 @@ func (memR *MempoolReactor) Receive(chID byte, src *p2p.Peer, msgBytes []byte) {
func (memR *MempoolReactor) ResetForBlockAndState(block *types.Block, state *sm.State) {
ri := memR.Mempool.ResetForBlockAndState(block, state)
for _, peer := range memR.Switch.Peers().List() {
peerMempoolCh := peer.Data.Get(types.PeerMempoolChKey).(chan ResetInfo)
peerMempoolChI := peer.Data.Get(types.PeerMempoolChKey)
if peerMempoolChI == nil {
// peer was added to switch but not yet to the memR
continue
}
peerMempoolCh := peerMempoolChI.(chan ResetInfo)
select {
case peerMempoolCh <- ri:
default:


Loading…
Cancel
Save