les: fixed nexClientPool balance iterator

This commit is contained in:
Zsolt Felfoldi 2019-11-25 11:39:41 +01:00
parent ab4a4af71a
commit be4fb5757a
2 changed files with 6 additions and 3 deletions

View file

@ -187,8 +187,10 @@ func newClientPool(db ethdb.Database, minCap, freeClientCap uint64, clock mclock
var stop bool
l := len(ids)
if l == 1000 {
stop = true
l--
start = ids[l]
} else {
stop = true
}
for i := 0; i < l; i++ {
pool.disconnectedBalances += pool.ndb.getOrNewPB(ids[i]).value

View file

@ -176,7 +176,7 @@ func (s *LesServer) Start(srvr *p2p.Server) {
go s.capacityManagement()
if srvr.DiscV5 != nil {
srvr.DiscV5.RegisterTalkHandler("les", s.handler.talkRequestHandler)
srvr.DiscV5.RegisterTalkHandler("lespay", s.handler.talkRequestHandler)
for _, topic := range s.lesTopics {
topic := topic
go func() {
@ -195,8 +195,9 @@ func (s *LesServer) Stop() {
close(s.closeCh)
if s.srvr.DiscV5 != nil {
s.srvr.DiscV5.RemoveTalkHandler("les")
s.srvr.DiscV5.RemoveTalkHandler("lespay")
}
s.tokenSale.stop()
// Disconnect existing sessions.
// This also closes the gate for any new registrations on the peer set.