From 5a8320b1eb9e966c62058c534dfe9e2b359e2324 Mon Sep 17 00:00:00 2001 From: Zsolt Felfoldi Date: Sun, 10 Nov 2019 21:32:41 +0100 Subject: [PATCH] les: changed error message, added balance tracker update --- les/api.go | 2 +- les/clientpool.go | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/les/api.go b/les/api.go index 12b2553a3c..7da65b74d7 100644 --- a/les/api.go +++ b/les/api.go @@ -35,7 +35,7 @@ var ( errNotActivated = errors.New("checkpoint registrar is not activated") errUnknownBenchmarkType = errors.New("unknown benchmark type") errBalanceOverflow = errors.New("balance overflow") - errNoPriority = errors.New("not enough priority") + errNoPriority = errors.New("priority too low to raise capacity") ) const maxBalance = math.MaxInt64 diff --git a/les/clientpool.go b/les/clientpool.go index 6e61250cf9..96a7b90332 100644 --- a/les/clientpool.go +++ b/les/clientpool.go @@ -446,6 +446,7 @@ func (f *clientPool) balanceExhausted(id enode.ID) { f.connectedCap += f.freeClientCap - c.capacity totalConnectedGauge.Update(int64(f.connectedCap)) c.capacity = f.freeClientCap + c.balanceTracker.setCapacity(c.capacity) c.peer.updateCapacity(c.capacity) } pb := f.ndb.getOrNewPB(id)