mirror of
https://github.com/aljazceru/lightning.git
synced 2025-12-19 07:04:22 +01:00
onchaind: use lightningd to sign and broadcast htlc expired txs.
This is when they closed the channel, we can simply make our own tx to expire the HTLC. (The other case is where we closed the channel, and we have a special htlc_timeout tx which we have their signature for). Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This commit is contained in:
@@ -293,14 +293,15 @@ def test_htlc_sig_persistence(node_factory, bitcoind, executor):
|
||||
l1.start()
|
||||
|
||||
assert l1.daemon.is_in_log(r'Loaded 1 HTLC signatures from DB')
|
||||
l1.daemon.wait_for_logs([
|
||||
r'Peer permanent failure in CHANNELD_NORMAL: Funding transaction spent',
|
||||
r'Propose handling THEIR_UNILATERAL/OUR_HTLC by OUR_HTLC_TIMEOUT_TO_US'
|
||||
])
|
||||
|
||||
# Could happen in either order!
|
||||
l1.daemon.wait_for_log(r'Peer permanent failure in CHANNELD_NORMAL: Funding transaction spent')
|
||||
|
||||
((_, txid, blocks),) = l1.wait_for_onchaind_tx('OUR_HTLC_TIMEOUT_TO_US',
|
||||
'THEIR_UNILATERAL/OUR_HTLC')
|
||||
assert blocks == 5
|
||||
bitcoind.generate_block(5)
|
||||
l1.daemon.wait_for_log("Broadcasting OUR_HTLC_TIMEOUT_TO_US")
|
||||
time.sleep(3)
|
||||
bitcoind.generate_block(1)
|
||||
bitcoind.generate_block(1, wait_for_mempool=txid)
|
||||
l1.daemon.wait_for_logs([
|
||||
r'Owning output . (\d+)sat .SEGWIT. txid',
|
||||
])
|
||||
|
||||
Reference in New Issue
Block a user