aboutsummaryrefslogtreecommitdiffstats
path: root/eth/handler.go
diff options
context:
space:
mode:
authorobscuren <geffobscura@gmail.com>2015-04-19 05:56:08 +0800
committerobscuren <geffobscura@gmail.com>2015-04-19 05:56:08 +0800
commit50e096e627c8c07b4dda3a7221dda5f32dc5c5cb (patch)
treedd4d24e45e14ce075db255849a35e82259f43ba8 /eth/handler.go
parent03b4cf74a2d2ce2f1ff39f0354b9577425e6524e (diff)
downloaddexon-50e096e627c8c07b4dda3a7221dda5f32dc5c5cb.tar.gz
dexon-50e096e627c8c07b4dda3a7221dda5f32dc5c5cb.tar.zst
dexon-50e096e627c8c07b4dda3a7221dda5f32dc5c5cb.zip
downloader: don't remove peers. keep them around
Diffstat (limited to 'eth/handler.go')
-rw-r--r--eth/handler.go11
1 files changed, 11 insertions, 0 deletions
diff --git a/eth/handler.go b/eth/handler.go
index 749809175..effe25ae3 100644
--- a/eth/handler.go
+++ b/eth/handler.go
@@ -185,7 +185,16 @@ func (self *ProtocolManager) handleMsg(p *peer) error {
if request.Amount > maxHashes {
request.Amount = maxHashes
}
+
hashes := self.chainman.GetBlockHashesFromHash(request.Hash, request.Amount)
+
+ if glog.V(logger.Debug) {
+ if len(hashes) == 0 {
+ glog.Infof("invalid block hash %x", request.Hash.Bytes()[:4])
+ }
+ }
+
+ // returns either requested hashes or nothing (i.e. not found)
return p.sendBlockHashes(hashes)
case BlockHashesMsg:
msgStream := rlp.NewStream(msg.Payload)
@@ -282,6 +291,7 @@ func (self *ProtocolManager) handleMsg(p *peer) error {
return nil
}
self.BroadcastBlock(hash, request.Block)
+ fmt.Println(request.Block.Hash().Hex(), "our calculated TD =", request.Block.Td, "their TD =", request.TD)
} else {
// adding blocks is synchronous
go func() {
@@ -291,6 +301,7 @@ func (self *ProtocolManager) handleMsg(p *peer) error {
return
}
self.BroadcastBlock(hash, request.Block)
+ fmt.Println(request.Block.Hash().Hex(), "our calculated TD =", request.Block.Td, "their TD =", request.TD)
}()
}
default: