core: return the index of the block that failed when inserting a chain

This commit is contained in:
obscuren
2015-04-29 14:00:24 +02:00
parent 764e81bf12
commit 735b029db9
7 changed files with 15 additions and 14 deletions

View File

@ -376,7 +376,7 @@ func (self *ProtocolManager) handleMsg(p *peer) error {
// if the parent exists we process the block and propagate to our peers
// if the parent does not exists we delegate to the downloader.
if self.chainman.HasBlock(request.Block.ParentHash()) {
if err := self.chainman.InsertChain(types.Blocks{request.Block}); err != nil {
if _, err := self.chainman.InsertChain(types.Blocks{request.Block}); err != nil {
// handle error
return nil
}