diff options
author | obscuren <geffobscura@gmail.com> | 2014-04-29 18:36:27 +0800 |
---|---|---|
committer | obscuren <geffobscura@gmail.com> | 2014-04-29 18:36:27 +0800 |
commit | 38d6b67b5cfbfb63620a244ea01b5b534917128f (patch) | |
tree | 42b4f55e4cd5c2f2a2c28f8551d8b92686abf567 /peer.go | |
parent | 5516efdfa0494e028fc3649e4a38da81c56ed598 (diff) | |
download | dexon-38d6b67b5cfbfb63620a244ea01b5b534917128f.tar.gz dexon-38d6b67b5cfbfb63620a244ea01b5b534917128f.tar.zst dexon-38d6b67b5cfbfb63620a244ea01b5b534917128f.zip |
Fixed state problem
Diffstat (limited to 'peer.go')
-rw-r--r-- | peer.go | 6 |
1 files changed, 4 insertions, 2 deletions
@@ -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 |