diff options
author | Zsolt Felfoldi <zsfelfoldi@gmail.com> | 2016-12-10 13:50:36 +0800 |
---|---|---|
committer | Zsolt Felfoldi <zsfelfoldi@gmail.com> | 2016-12-10 16:53:25 +0800 |
commit | f12f8a6c14dbaf6e6531cea1b0cf169b851e1894 (patch) | |
tree | 41f0d7dd9f5fe21cbb8615a59cc08b9594f83770 /les/odr.go | |
parent | c57c54ce96628aeb6345776310123a80593f0143 (diff) | |
download | dexon-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.go | 3 |
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)) }) } |