@@ -889,18 +889,19 @@ def test_coinmoves_unilateral_htlc_timeout(node_factory, bitcoind):
889889 expected_chain1 += [{'account_id' : 'wallet' ,
890890 'blockheight' : 115 ,
891891 'credit_msat' : 0 ,
892- 'debit_msat' : 15579000 ,
892+ 'debit_msat' : anchor_change_msats ,
893893 'extra_tags' : [],
894- 'output_msat' : 15579000 ,
894+ 'output_msat' : anchor_change_msats ,
895895 'primary_tag' : 'withdrawal' ,
896896 'spending_txid' : htlc_timeout_txid ,
897897 'utxo' : f"{ anchor_spend_txid } :0" },
898+ # Change
898899 {'account_id' : 'wallet' ,
899900 'blockheight' : 115 ,
900- 'credit_msat' : 6358000 ,
901+ 'credit_msat' : ( 15579000 + 6358000 ) - anchor_change_msats ,
901902 'debit_msat' : 0 ,
902903 'extra_tags' : [],
903- 'output_msat' : 6358000 ,
904+ 'output_msat' : ( 15579000 + 6358000 ) - anchor_change_msats ,
904905 'primary_tag' : 'deposit' ,
905906 'utxo' : f"{ htlc_timeout_txid } :1" },
906907 {'account_id' : fundchannel ['channel_id' ],
@@ -1500,6 +1501,9 @@ def test_coinmoves_unilateral_htlc_fulfilled_oneside(node_factory, bitcoind):
15001501 line = l1 .daemon .is_in_log ('Tracking output.*/OUTPUT_TO_THEM' )
15011502 to_l2 = int (re .search (r'output [0-9a-f]{64}:([0-9]):' , line ).group (1 ))
15021503
1504+ # Usually 16186000, but if we're lucky it's 16193000
1505+ anchor_change_msats = bitcoind .rpc .gettxout (anchor_spend_txid , 0 )['value' ] * 100_000_000_000
1506+
15031507 expected_chain1 += [{'account_id' : 'wallet' , # Anchor spend from fundchannel change
15041508 'blockheight' : 104 ,
15051509 'credit_msat' : 0 ,
@@ -1511,10 +1515,10 @@ def test_coinmoves_unilateral_htlc_fulfilled_oneside(node_factory, bitcoind):
15111515 'utxo' : f"{ fundchannel ['txid' ]} :{ fundchannel ['outnum' ] ^ 1 } " },
15121516 {'account_id' : 'wallet' , # Change from anchor spend
15131517 'blockheight' : 104 ,
1514- 'credit_msat' : 16186000 ,
1518+ 'credit_msat' : anchor_change_msats ,
15151519 'debit_msat' : 0 ,
15161520 'extra_tags' : [],
1517- 'output_msat' : 16186000 ,
1521+ 'output_msat' : anchor_change_msats ,
15181522 'primary_tag' : 'deposit' ,
15191523 'utxo' : f"{ anchor_spend_txid } :0" },
15201524 {'account_id' : fundchannel ['channel_id' ],
0 commit comments