les: changed error message, added balance tracker update

This commit is contained in:
Zsolt Felfoldi 2019-11-10 21:32:41 +01:00
parent 6614683246
commit 5a8320b1eb
2 changed files with 2 additions and 1 deletions

View file

@ -35,7 +35,7 @@ var (
errNotActivated = errors.New("checkpoint registrar is not activated") errNotActivated = errors.New("checkpoint registrar is not activated")
errUnknownBenchmarkType = errors.New("unknown benchmark type") errUnknownBenchmarkType = errors.New("unknown benchmark type")
errBalanceOverflow = errors.New("balance overflow") errBalanceOverflow = errors.New("balance overflow")
errNoPriority = errors.New("not enough priority") errNoPriority = errors.New("priority too low to raise capacity")
) )
const maxBalance = math.MaxInt64 const maxBalance = math.MaxInt64

View file

@ -446,6 +446,7 @@ func (f *clientPool) balanceExhausted(id enode.ID) {
f.connectedCap += f.freeClientCap - c.capacity f.connectedCap += f.freeClientCap - c.capacity
totalConnectedGauge.Update(int64(f.connectedCap)) totalConnectedGauge.Update(int64(f.connectedCap))
c.capacity = f.freeClientCap c.capacity = f.freeClientCap
c.balanceTracker.setCapacity(c.capacity)
c.peer.updateCapacity(c.capacity) c.peer.updateCapacity(c.capacity)
} }
pb := f.ndb.getOrNewPB(id) pb := f.ndb.getOrNewPB(id)