Fix channel allocation when relays are provisioned

Fix a bug where the channel allocation algorithm failed due to
necessary relays not having been provisioned yet.
Passed the newly created relay numbers to the allocation function
and assumed their CHANMAX would be the same as all other relays for
the same network.
This commit is contained in:
2019-10-12 21:40:50 +01:00
parent 0321651c20
commit 6ad6d6dc50
2 changed files with 29 additions and 14 deletions

View File

@@ -63,8 +63,11 @@ def provisionRelay(num, network):
return
def provisionMultipleRelays(net, relaysNeeded):
numsProvisioned = []
for i in range(relaysNeeded):
num, alias = main.network[net].add_relay()
numsProvisioned.append(num)
provisionRelay(num, net)
main.saveConf("network")
return numsProvisioned