db: store claimed per_commitment_point from option_data_loss_protect.

This means we don't try to unilaterally close after a restart, *and*
we can tell onchaind to try to use the point to recover funds when the
peer unilaterally closes.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This commit is contained in:
Rusty Russell
2018-08-17 14:36:36 +09:30
committed by Christian Decker
parent 1a4084442b
commit a5ecc95c42
7 changed files with 37 additions and 10 deletions

View File

@@ -1219,6 +1219,11 @@ def test_dataloss_protection(node_factory, bitcoind):
# l2 should still recover something!
bitcoind.generate_block(1)
l2.daemon.wait_for_log("ERROR: Unknown commitment #2, recovering our funds!")
# Restarting l2, and it should remember from db.
l2.restart()
l2.daemon.wait_for_log("ERROR: Unknown commitment #2, recovering our funds!")
bitcoind.generate_block(100)
l2.daemon.wait_for_log('WIRE_ONCHAIN_ALL_IRREVOCABLY_RESOLVED')