diff options
author | obscuren <geffobscura@gmail.com> | 2014-05-14 17:29:57 +0800 |
---|---|---|
committer | obscuren <geffobscura@gmail.com> | 2014-05-14 17:29:57 +0800 |
commit | 0c1f732c64b7c1380b2f0422ee82d462ea88dc03 (patch) | |
tree | 2e80c21388ee83a0503050e04c89b72695f71737 /peer.go | |
parent | a4883a029f3585d7e263661c30cbd147f3d5d655 (diff) | |
download | go-tangerine-0c1f732c64b7c1380b2f0422ee82d462ea88dc03.tar go-tangerine-0c1f732c64b7c1380b2f0422ee82d462ea88dc03.tar.gz go-tangerine-0c1f732c64b7c1380b2f0422ee82d462ea88dc03.tar.bz2 go-tangerine-0c1f732c64b7c1380b2f0422ee82d462ea88dc03.tar.lz go-tangerine-0c1f732c64b7c1380b2f0422ee82d462ea88dc03.tar.xz go-tangerine-0c1f732c64b7c1380b2f0422ee82d462ea88dc03.tar.zst go-tangerine-0c1f732c64b7c1380b2f0422ee82d462ea88dc03.zip |
Do not queue messages if the peer isn't connected (e.g. timing out)
Diffstat (limited to 'peer.go')
-rw-r--r-- | peer.go | 4 |
1 files changed, 4 insertions, 0 deletions
@@ -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 } |