mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-03-02 09:33:46 +00:00
Do not queue messages if the peer isn't connected (e.g. timing out)
This commit is contained in:
parent
a4883a029f
commit
0c1f732c64
2 changed files with 4 additions and 1 deletions
|
|
@ -199,7 +199,6 @@ func (sm *StateManager) ProcessBlock(block *Block, dontReact bool) error {
|
|||
}
|
||||
|
||||
sm.Ethereum.Broadcast(ethwire.MsgBlockTy, []interface{}{block.Value().Val})
|
||||
|
||||
} else {
|
||||
fmt.Println("total diff failed")
|
||||
}
|
||||
|
|
|
|||
4
peer.go
4
peer.go
|
|
@ -187,6 +187,10 @@ func NewOutboundPeer(addr string, ethereum *Ethereum, caps Caps) *Peer {
|
|||
|
||||
// Outputs any RLP encoded data to the peer
|
||||
func (p *Peer) QueueMessage(msg *ethwire.Msg) {
|
||||
if atomic.LoadInt32(&p.connected) != 1 {
|
||||
return
|
||||
}
|
||||
|
||||
p.outputQueue <- msg
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue