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

@@ -3667,8 +3667,7 @@ We send an HTLC, and peer unilaterally closes: do we close upstream?
with pytest.raises(RpcError, match=r'WIRE_TEMPORARY_CHANNEL_FAILURE \(reply from remote\)'):
l1.rpc.waitsendpay(ph2, timeout=TIMEOUT)
# l3 closes unilaterally.
wait_for(lambda: only_one(l3.rpc.listpeers(l2.info['id'])['peers'])['connected'] is False)
# Make close unilaterally.
l3.rpc.close(l2.info['id'], 1)
l3.daemon.wait_for_log('sendrawtransaction')