Adding more debug statements in ECA system

This commit is contained in:
Mark Veidemanis 2022-08-11 20:36:24 +01:00
parent 73b0518a8f
commit c4db8ec99d
Signed by: m
GPG Key ID: 5ACFCEED46C0904F
1 changed files with 3 additions and 0 deletions

View File

@ -71,6 +71,7 @@ def emptyChanAllocate(net, flist, relay, new):
toalloc = len(flist)
if toalloc > sum(chanfree[0].values()):
correction = round(toalloc - sum(chanfree[0].values()) / chanfree[1])
debug(f"emptyChanAllocate() not enough free channels: toalloc:{toalloc} free:{chanfree[0]} chanlimit:{chanfree[1]} correction:{correction}")
warn("Ran out of channel spaces, provisioning additional %i relays for %s" % (correction, net))
modules.provision.provisionMultipleRelays(net, correction)
return False
@ -133,11 +134,13 @@ def keepChannels(net, listinfo, mean, sigrelay, relay):
return
if coverAll:
needed = relay - len(getActiveRelays(net))
debug(f"keepChannels() coverAll asking to provision {needed} relays for {net} relay:{relay}")
newNums = modules.provision.provisionMultipleRelays(net, needed)
flist = [i[0] for i in listinfo]
populateChans(net, flist, relay, newNums)
else:
needed = sigrelay - len(getActiveRelays(net))
debug(f"keepChannels() NOT coverAll asking to provision {needed} relays for {net} sigrelay:{sigrelay}")
newNums = modules.provision.provisionMultipleRelays(net, needed)
siglist = [i[0] for i in listinfo if int(i[1]) > mean]
populateChans(net, siglist, sigrelay, newNums)