@@ -1435,20 +1435,16 @@ impl<Signer: Sign> ChannelMonitor<Signer> {
1435
1435
let mut delayed_output_pending = None ;
1436
1436
for event in us. onchain_events_awaiting_threshold_conf. iter( ) {
1437
1437
match event. event {
1438
- OnchainEvent :: HTLCUpdate {
1439
- commitment_tx_output_idx, onchain_value_satoshis, htlc_value_satoshis, .. }
1438
+ OnchainEvent :: HTLCUpdate { commitment_tx_output_idx, htlc_value_satoshis, .. }
1440
1439
if commitment_tx_output_idx == Some ( htlc_commitment_tx_output_idx) => {
1441
1440
debug_assert!( htlc_update_pending. is_none( ) ) ;
1442
- htlc_update_pending = Some ( (
1443
- onchain_value_satoshis. unwrap_or( htlc_value_satoshis. unwrap( ) ) ,
1444
- event. confirmation_threshold( ) ) ) ;
1441
+ debug_assert_eq!( htlc_value_satoshis. unwrap( ) , htlc. amount_msat / 1000 ) ;
1442
+ htlc_update_pending = Some ( event. confirmation_threshold( ) ) ;
1445
1443
} ,
1446
- OnchainEvent :: HTLCSpendConfirmation {
1447
- commitment_tx_output_idx, preimage, onchain_value_satoshis, .. }
1444
+ OnchainEvent :: HTLCSpendConfirmation { commitment_tx_output_idx, preimage, .. }
1448
1445
if commitment_tx_output_idx == htlc_commitment_tx_output_idx => {
1449
1446
debug_assert!( htlc_spend_pending. is_none( ) ) ;
1450
- htlc_spend_pending = Some ( ( event. confirmation_threshold( ) ,
1451
- preimage. is_some( ) , onchain_value_satoshis) ) ;
1447
+ htlc_spend_pending = Some ( ( event. confirmation_threshold( ) , preimage. is_some( ) ) ) ;
1452
1448
} ,
1453
1449
OnchainEvent :: MaturingOutput {
1454
1450
descriptor: SpendableOutputDescriptor :: DelayedPaymentOutput ( ref descriptor) }
@@ -1481,9 +1477,9 @@ impl<Signer: Sign> ChannelMonitor<Signer> {
1481
1477
// If the payment was outbound, check if there's an HTLCUpdate
1482
1478
// indicating we have spent this HTLC with a timeout, claiming it back
1483
1479
// and awaiting confirmations on it.
1484
- if let Some ( ( value , conf_thresh) ) = htlc_update_pending {
1480
+ if let Some ( conf_thresh) = htlc_update_pending {
1485
1481
res. push( Balance :: ClaimableAwaitingConfirmations {
1486
- claimable_amount_satoshis: value ,
1482
+ claimable_amount_satoshis: htlc . amount_msat / 1000 ,
1487
1483
confirmation_height: conf_thresh,
1488
1484
} ) ;
1489
1485
} else {
@@ -1499,9 +1495,9 @@ impl<Signer: Sign> ChannelMonitor<Signer> {
1499
1495
// preimage, we lost funds to our counterparty! We will then continue
1500
1496
// to show it as ContentiousClaimable until ANTI_REORG_DELAY.
1501
1497
debug_assert!( htlc_update_pending. is_none( ) ) ;
1502
- if let Some ( ( conf_thresh, true , value ) ) = htlc_spend_pending {
1498
+ if let Some ( ( conf_thresh, true ) ) = htlc_spend_pending {
1503
1499
res. push( Balance :: ClaimableAwaitingConfirmations {
1504
- claimable_amount_satoshis: value . unwrap_or ( htlc. amount_msat / 1000 ) ,
1500
+ claimable_amount_satoshis: htlc. amount_msat / 1000 ,
1505
1501
confirmation_height: conf_thresh,
1506
1502
} ) ;
1507
1503
} else {
0 commit comments