aboutsummaryrefslogtreecommitdiffstats
path: root/eth/protocol.go
diff options
context:
space:
mode:
Diffstat (limited to 'eth/protocol.go')
-rw-r--r--eth/protocol.go12
1 files changed, 5 insertions, 7 deletions
diff --git a/eth/protocol.go b/eth/protocol.go
index b15868898..a85d15a0c 100644
--- a/eth/protocol.go
+++ b/eth/protocol.go
@@ -324,7 +324,7 @@ func (self *ethProtocol) handle() error {
// to simplify backend interface adding a new block
// uses AddPeer followed by AddBlock only if peer is the best peer
// (or selected as new best peer)
- if best, _ := self.blockPool.AddPeer(request.TD, hash, self.id, self.requestBlockHashes, self.requestBlocks, self.protoErrorDisconnect); best {
+ if _, suspended := self.blockPool.AddPeer(request.TD, hash, self.id, self.requestBlockHashes, self.requestBlocks, self.protoErrorDisconnect); !suspended {
self.blockPool.AddBlock(request.Block, self.id)
}
@@ -415,11 +415,9 @@ func (self *ethProtocol) sendStatus() error {
}
func (self *ethProtocol) protoErrorDisconnect(err *errs.Error) {
- //err.Log(self.peer.Logger)
err.Log(glog.V(logger.Info))
- /*
- if err.Fatal() {
- self.peer.Disconnect(p2p.DiscSubprotocolError)
- }
- */
+ if err.Fatal() {
+ self.peer.Disconnect(p2p.DiscSubprotocolError)
+ }
+
}