mirror of
https://github.com/aljazceru/lightning.git
synced 2025-12-19 07:04:22 +01:00
onchaind: use lightningd for spending our unilateral "to us" output.
This follows the same pattern as the "spend htlc tx" in fact. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This commit is contained in:
@@ -3833,11 +3833,13 @@ def test_upgrade_statickey_onchaind(node_factory, executor, bitcoind):
|
||||
l2.start()
|
||||
|
||||
# They should both handle it fine.
|
||||
l1.daemon.wait_for_log('Propose handling OUR_UNILATERAL/DELAYED_OUTPUT_TO_US by OUR_DELAYED_RETURN_TO_WALLET .* after 5 blocks')
|
||||
((_, txid, blocks),) = l1.wait_for_onchaind_tx('OUR_DELAYED_RETURN_TO_WALLET',
|
||||
'OUR_UNILATERAL/DELAYED_OUTPUT_TO_US')
|
||||
assert blocks == 4
|
||||
l2.daemon.wait_for_logs(['Ignoring output .*: THEIR_UNILATERAL/OUTPUT_TO_US',
|
||||
'Ignoring output .*: THEIR_UNILATERAL/DELAYED_OUTPUT_TO_THEM'])
|
||||
bitcoind.generate_block(5)
|
||||
bitcoind.generate_block(100, wait_for_mempool=1)
|
||||
bitcoind.generate_block(4)
|
||||
bitcoind.generate_block(100, wait_for_mempool=txid)
|
||||
|
||||
# This works even if they disconnect and listpeerchannels() is empty:
|
||||
wait_for(lambda: len(l2.rpc.listpeerchannels()['channels']) == 0)
|
||||
@@ -3858,12 +3860,14 @@ def test_upgrade_statickey_onchaind(node_factory, executor, bitcoind):
|
||||
l2.start()
|
||||
|
||||
# They should both handle it fine.
|
||||
l1.daemon.wait_for_log('Propose handling OUR_UNILATERAL/DELAYED_OUTPUT_TO_US by OUR_DELAYED_RETURN_TO_WALLET .* after 5 blocks')
|
||||
((_, txid, blocks),) = l1.wait_for_onchaind_tx('OUR_DELAYED_RETURN_TO_WALLET',
|
||||
'OUR_UNILATERAL/DELAYED_OUTPUT_TO_US')
|
||||
assert blocks == 4
|
||||
l2.daemon.wait_for_logs(['Ignoring output .*: THEIR_UNILATERAL/OUTPUT_TO_US',
|
||||
'Ignoring output .*: THEIR_UNILATERAL/DELAYED_OUTPUT_TO_THEM'])
|
||||
|
||||
bitcoind.generate_block(5)
|
||||
bitcoind.generate_block(100, wait_for_mempool=1)
|
||||
bitcoind.generate_block(4)
|
||||
bitcoind.generate_block(100, wait_for_mempool=txid)
|
||||
|
||||
# This works even if they disconnect and listpeerchannels() is empty:
|
||||
wait_for(lambda: len(l2.rpc.listpeerchannels()['channels']) == 0)
|
||||
|
||||
Reference in New Issue
Block a user