lightningd: remove some "single active channel" assumptions.

Generally this means converting a lazy "peer_active_channel(peer)" call
into an explicit iteration.

1. notify_feerate_change: call all channels (ignores non-active ones anyway).
2. peer_get_owning_subd remove unused function.
3. peer_connected hook: don't save channel, do lookup and iterate channels.
4. In json_setchannelfee "all" remove useless call to peer_active_channel
   since we check state anyway, and iterate.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This commit is contained in:
Rusty Russell
2022-03-23 07:00:54 +10:30
parent 7de7b7be61
commit 90be2cc104
4 changed files with 47 additions and 81 deletions

View File

@@ -935,7 +935,7 @@ def test_channel_state_changed_unilateral(node_factory, bitcoind):
assert(l2.rpc.listpeers()['peers'][0]['channels'][0]['closer'] == 'local')
if EXPERIMENTAL_DUAL_FUND:
l1.daemon.wait_for_log(r'Peer has reconnected, state')
l2.daemon.wait_for_log(r'Peer has reconnected, state')
l2.daemon.wait_for_log(r'Telling connectd to send error')
# l1 will receive error, and go into AWAITING_UNILATERAL
# FIXME: l2 should re-xmit shutdown, but it doesn't until it's mined :(