From d651ff968a468abebcaf929964d4e9edd3d9ba97 Mon Sep 17 00:00:00 2001 From: obscuren Date: Sat, 4 Apr 2015 22:06:50 +0200 Subject: [PATCH] Temp removed unrequested block error @zelig look in to this please --- blockpool/blockpool.go | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/blockpool/blockpool.go b/blockpool/blockpool.go index e65032fb5..3ae4e0620 100644 --- a/blockpool/blockpool.go +++ b/blockpool/blockpool.go @@ -653,15 +653,19 @@ func (self *BlockPool) AddBlock(block *types.Block, peerId string) { } sender.lock.Unlock() - if entry == nil { - plog.DebugDetailf("AddBlock: unrequested block %s received from peer <%s> (head: %s)", hex(hash), peerId, hex(sender.currentBlockHash)) - sender.addError(ErrUnrequestedBlock, "%x", hash) + /* @zelig !!! + requested 5 hashes from both A & B. A responds sooner then B, process blocks. Close section. + delayed B sends you block ... UNREQUESTED. Blocked + if entry == nil { + plog.DebugDetailf("AddBlock: unrequested block %s received from peer <%s> (head: %s)", hex(hash), peerId, hex(sender.currentBlockHash)) + sender.addError(ErrUnrequestedBlock, "%x", hash) - self.status.lock.Lock() - self.status.badPeers[peerId]++ - self.status.lock.Unlock() - return - } + self.status.lock.Lock() + self.status.badPeers[peerId]++ + self.status.lock.Unlock() + return + } + */ } if entry == nil { return