aboutsummaryrefslogtreecommitdiffstats
path: root/les/odr.go
diff options
context:
space:
mode:
authorZsolt Felfoldi <zsfelfoldi@gmail.com>2016-12-10 13:50:36 +0800
committerZsolt Felfoldi <zsfelfoldi@gmail.com>2016-12-10 16:53:25 +0800
commitf12f8a6c14dbaf6e6531cea1b0cf169b851e1894 (patch)
tree41f0d7dd9f5fe21cbb8615a59cc08b9594f83770 /les/odr.go
parentc57c54ce96628aeb6345776310123a80593f0143 (diff)
downloaddexon-f12f8a6c14dbaf6e6531cea1b0cf169b851e1894.tar.gz
dexon-f12f8a6c14dbaf6e6531cea1b0cf169b851e1894.tar.zst
dexon-f12f8a6c14dbaf6e6531cea1b0cf169b851e1894.zip
les, light: add block availability check for ODR requests
Diffstat (limited to 'les/odr.go')
-rw-r--r--les/odr.go3
1 files changed, 3 insertions, 0 deletions
diff --git a/les/odr.go b/les/odr.go
index 4bfbdcb4d..8878508c4 100644
--- a/les/odr.go
+++ b/les/odr.go
@@ -188,6 +188,9 @@ func (self *LesOdr) networkRequest(ctx context.Context, lreq LesOdrRequest) erro
var p *peer
if self.serverPool != nil {
p = self.serverPool.selectPeer(func(p *peer) (bool, uint64) {
+ if !lreq.CanSend(p) {
+ return false, 0
+ }
return true, p.fcServer.CanSend(lreq.GetCost(p))
})
}