gossipd: don't close non-local channels immediately, add 12 block delay.

This adds a new "chan_dying" message to the gossip_store, but since we
already changed the minor version in this PR, we don't bump it again.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Changelog-Added: Protocol: We now delay forgetting funding-spent channels for 12 blocks (as per latest BOLTs, to support splicing in future).
This commit is contained in:
Rusty Russell
2022-09-14 13:20:32 +09:30
parent f0fa42bd73
commit a1f62ba0e7
12 changed files with 204 additions and 35 deletions

View File

@@ -96,7 +96,7 @@ def test_block_backfill(node_factory, bitcoind, chainparams):
# Now close the channel and make sure `l3` cleans up correctly:
txid = l1.rpc.close(l2.info['id'])['txid']
bitcoind.generate_block(1, wait_for_mempool=txid)
bitcoind.generate_block(13, wait_for_mempool=txid)
wait_for(lambda: len(l3.rpc.listchannels()['channels']) == 0)