From fe86d3015572e1bf264473c62d3b94dae220f3f6 Mon Sep 17 00:00:00 2001 From: Mark Veidemanis Date: Sat, 31 Oct 2020 23:55:11 +0000 Subject: [PATCH] Fix various bugs and off by one with provisioning --- modules/chankeep.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/modules/chankeep.py b/modules/chankeep.py index 0fc7a12..3de11b0 100644 --- a/modules/chankeep.py +++ b/modules/chankeep.py @@ -41,7 +41,10 @@ def emptyChanAllocate(net, flist, relay, new): allocated = {} toalloc = len(flist) if toalloc > sum(chanfree[0].values()): - error("Too many channels to allocate for %s - channels joined since initial query, wait a while" % net) + correction = round(toalloc-sum(chanfree[0].values()) / chanfree[1]) + #print("correction", correction) + warn("Ran out of channel spaces, provisioning additional %i relays for %s" % (correction, net)) + #newNums = modules.provision.provisionMultipleRelays(net, correction) return False for i in chanfree[0].keys(): for x in range(chanfree[0][i]):