lightningd: drive all reconnections out of disconnections.

The only places which should call try_reconnect now are the "connect"
command, and the disconnect path when it decides there's still an
active channel.

This introduces one subtlety: if we disconnect when there's no active
channel, but then the subd makes one, we have to catch that case!

This temporarily reverts "slow" reconnections to fast ones: see next
patch.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This commit is contained in:
Rusty Russell
2022-07-18 21:42:28 +09:30
committed by neil saitug
parent a3c4908f4a
commit 02e169fd27
12 changed files with 98 additions and 64 deletions

View File

@@ -129,10 +129,6 @@ def test_multifunding_v2_best_effort(node_factory, bitcoind):
for node in node_list:
node.daemon.wait_for_log(r'to CLOSINGD_COMPLETE')
# Make sure disconnections are complete
if not failed_sign:
wait_for(lambda: all([c['connected'] is False for c in l1.rpc.listpeers()['peers']]))
# With 2 down, it will fail to fund channel
l2.stop()
l3.stop()