aboutsummaryrefslogtreecommitdiffstats
path: root/les/peer.go
diff options
context:
space:
mode:
authorZsolt Felfoldi <zsfelfoldi@gmail.com>2016-12-15 18:13:52 +0800
committerZsolt Felfoldi <zsfelfoldi@gmail.com>2017-01-06 11:34:31 +0800
commit93f9c023ccda2256079484d6c2a3159818ba6691 (patch)
treef2ed341904459184587ca1cc8667d8169761f752 /les/peer.go
parente0ee0cc66a4416edd47232649f4d4bca4a5e3c07 (diff)
downloaddexon-93f9c023ccda2256079484d6c2a3159818ba6691.tar
dexon-93f9c023ccda2256079484d6c2a3159818ba6691.tar.gz
dexon-93f9c023ccda2256079484d6c2a3159818ba6691.tar.bz2
dexon-93f9c023ccda2256079484d6c2a3159818ba6691.tar.lz
dexon-93f9c023ccda2256079484d6c2a3159818ba6691.tar.xz
dexon-93f9c023ccda2256079484d6c2a3159818ba6691.tar.zst
dexon-93f9c023ccda2256079484d6c2a3159818ba6691.zip
les: fixed selectPeer deadlock, improved request distribution
les/flowcontrol: using proper types for relative and absolute times
Diffstat (limited to 'les/peer.go')
-rw-r--r--les/peer.go4
1 files changed, 3 insertions, 1 deletions
diff --git a/les/peer.go b/les/peer.go
index 0a8db4975..770c9bf45 100644
--- a/les/peer.go
+++ b/les/peer.go
@@ -241,7 +241,9 @@ func (p *peer) RequestHeaderProofs(reqID, cost uint64, reqs []*ChtReq) error {
func (p *peer) SendTxs(cost uint64, txs types.Transactions) error {
glog.V(logger.Debug).Infof("%v relaying %v txs", p, len(txs))
- p.fcServer.SendRequest(0, cost)
+ reqID := getNextReqID()
+ p.fcServer.MustAssignRequest(reqID)
+ p.fcServer.SendRequest(reqID, cost)
return p2p.Send(p.rw, SendTxMsg, txs)
}