aboutsummaryrefslogtreecommitdiffstats
path: root/peer.go
diff options
context:
space:
mode:
authorobscuren <geffobscura@gmail.com>2014-04-29 18:36:27 +0800
committerobscuren <geffobscura@gmail.com>2014-04-29 18:36:27 +0800
commit38d6b67b5cfbfb63620a244ea01b5b534917128f (patch)
tree42b4f55e4cd5c2f2a2c28f8551d8b92686abf567 /peer.go
parent5516efdfa0494e028fc3649e4a38da81c56ed598 (diff)
downloaddexon-38d6b67b5cfbfb63620a244ea01b5b534917128f.tar.gz
dexon-38d6b67b5cfbfb63620a244ea01b5b534917128f.tar.zst
dexon-38d6b67b5cfbfb63620a244ea01b5b534917128f.zip
Fixed state problem
Diffstat (limited to 'peer.go')
-rw-r--r--peer.go6
1 files changed, 4 insertions, 2 deletions
diff --git a/peer.go b/peer.go
index 0ecd13e60..28ccc324c 100644
--- a/peer.go
+++ b/peer.go
@@ -449,8 +449,10 @@ func (p *Peer) HandleInbound() {
if parent != nil {
ethutil.Config.Log.Infof("[PEER] Found conical block, returning chain from: %x ", parent.Hash())
chain := p.ethereum.BlockChain().GetChainFromHash(parent.Hash(), amountOfBlocks)
- ethutil.Config.Log.Infof("[PEER] Returning %d blocks: %x ", len(chain), parent.Hash())
- p.QueueMessage(ethwire.NewMessage(ethwire.MsgBlockTy, chain))
+ if len(chain) > 0 {
+ ethutil.Config.Log.Infof("[PEER] Returning %d blocks: %x ", len(chain), parent.Hash())
+ p.QueueMessage(ethwire.NewMessage(ethwire.MsgBlockTy, chain))
+ }
} else {
ethutil.Config.Log.Infof("[PEER] Could not find a similar block")
// If no blocks are found we send back a reply with msg not in chain