aboutsummaryrefslogtreecommitdiffstats
path: root/eth
diff options
context:
space:
mode:
authorPéter Szilágyi <peterke@gmail.com>2016-03-03 19:06:23 +0800
committerJeffrey Wilcke <geffobscura@gmail.com>2016-03-03 22:10:32 +0800
commit869d9792b30c0c9d9ad0d6d37170bf76ac0271be (patch)
tree103db597f380713afcc16cf54a7a1d1f732d3505 /eth
parentd3f8b763bf599b536b3ebdd02cb274b255a3431e (diff)
downloadgo-tangerine-869d9792b30c0c9d9ad0d6d37170bf76ac0271be.tar
go-tangerine-869d9792b30c0c9d9ad0d6d37170bf76ac0271be.tar.gz
go-tangerine-869d9792b30c0c9d9ad0d6d37170bf76ac0271be.tar.bz2
go-tangerine-869d9792b30c0c9d9ad0d6d37170bf76ac0271be.tar.lz
go-tangerine-869d9792b30c0c9d9ad0d6d37170bf76ac0271be.tar.xz
go-tangerine-869d9792b30c0c9d9ad0d6d37170bf76ac0271be.tar.zst
go-tangerine-869d9792b30c0c9d9ad0d6d37170bf76ac0271be.zip
[release/1.3.5] eth: forward empty body responses to the downlaoder
(cherry picked from commit ae4982a365ae396f928c76e332777563c9cc6b40)
Diffstat (limited to 'eth')
-rw-r--r--eth/handler.go6
1 files changed, 5 insertions, 1 deletions
diff --git a/eth/handler.go b/eth/handler.go
index d1a6c040c..96bb554dd 100644
--- a/eth/handler.go
+++ b/eth/handler.go
@@ -491,7 +491,11 @@ func (pm *ProtocolManager) handleMsg(p *peer) error {
uncles[i] = body.Uncles
}
// Filter out any explicitly requested bodies, deliver the rest to the downloader
- if trasactions, uncles := pm.fetcher.FilterBodies(trasactions, uncles, time.Now()); len(trasactions) > 0 || len(uncles) > 0 {
+ filter := len(trasactions) > 0 || len(uncles) > 0
+ if filter {
+ trasactions, uncles = pm.fetcher.FilterBodies(trasactions, uncles, time.Now())
+ }
+ if len(trasactions) > 0 || len(uncles) > 0 || !filter {
err := pm.downloader.DeliverBodies(p.id, trasactions, uncles)
if err != nil {
glog.V(logger.Debug).Infoln(err)