diff options
author | Péter Szilágyi <peterke@gmail.com> | 2016-03-03 19:06:23 +0800 |
---|---|---|
committer | Jeffrey Wilcke <geffobscura@gmail.com> | 2016-03-03 22:10:32 +0800 |
commit | 869d9792b30c0c9d9ad0d6d37170bf76ac0271be (patch) | |
tree | 103db597f380713afcc16cf54a7a1d1f732d3505 | |
parent | d3f8b763bf599b536b3ebdd02cb274b255a3431e (diff) | |
download | go-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)
-rw-r--r-- | eth/handler.go | 6 |
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) |