@@ -541,7 +541,7 @@ impl_writeable_tlv_based_enum_upgradable!(ChannelMonitorUpdateStep,
541
541
/// be provided.
542
542
#[ derive( Clone , Debug , PartialEq , Eq ) ]
543
543
#[ cfg_attr( test, derive( PartialOrd , Ord ) ) ]
544
- pub enum ClaimableBalance {
544
+ pub enum Balance {
545
545
/// The channel is not yet closed (or the commitment or closing transaction has not yet
546
546
/// appeared in a block). The given balance is claimable (less on-chain fees) if the channel is
547
547
/// force-closed now.
@@ -566,7 +566,7 @@ pub enum ClaimableBalance {
566
566
///
567
567
/// Once the spending transaction confirms, before it has reached enough confirmations to be
568
568
/// considered safe from chain reorganizations, the balance will instead be provided via
569
- /// [`ClaimableBalance ::ClaimableAwaitingConfirmations`].
569
+ /// [`Balance ::ClaimableAwaitingConfirmations`].
570
570
ContentiousClaimable {
571
571
/// The amount available to claim, in satoshis, excluding the on-chain fees which will be
572
572
/// required to do so.
@@ -1369,9 +1369,9 @@ impl<Signer: Sign> ChannelMonitor<Signer> {
1369
1369
/// state(s) may not be fully captured here.
1370
1370
// TODO, fix that ^
1371
1371
///
1372
- /// See [`ClaimableBalance `] for additional details on the types of claimable balances which
1372
+ /// See [`Balance `] for additional details on the types of claimable balances which
1373
1373
/// may be returned here and their meanings.
1374
- pub fn get_claimable_balances ( & self ) -> Vec < ClaimableBalance > {
1374
+ pub fn get_claimable_balances ( & self ) -> Vec < Balance > {
1375
1375
let mut res = Vec :: new ( ) ;
1376
1376
let us = self . inner . lock ( ) . unwrap ( ) ;
1377
1377
@@ -1405,12 +1405,12 @@ impl<Signer: Sign> ChannelMonitor<Signer> {
1405
1405
} else { None }
1406
1406
} ) ;
1407
1407
if let Some ( conf_thresh) = htlc_update_pending {
1408
- res. push( ClaimableBalance :: ClaimableAwaitingConfirmations {
1408
+ res. push( Balance :: ClaimableAwaitingConfirmations {
1409
1409
claimable_amount_satoshis: htlc. amount_msat / 1000 ,
1410
1410
confirmation_height: conf_thresh,
1411
1411
} ) ;
1412
1412
} else {
1413
- res. push( ClaimableBalance :: MaybeClaimableHTLCAwaitingTimeout {
1413
+ res. push( Balance :: MaybeClaimableHTLCAwaitingTimeout {
1414
1414
claimable_amount_satoshis: htlc. amount_msat / 1000 ,
1415
1415
claimable_height: htlc. cltv_expiry,
1416
1416
} ) ;
@@ -1429,12 +1429,12 @@ impl<Signer: Sign> ChannelMonitor<Signer> {
1429
1429
} else { None }
1430
1430
} ) ;
1431
1431
if let Some ( ( conf_thresh, true ) ) = htlc_spend_pending {
1432
- res. push( ClaimableBalance :: ClaimableAwaitingConfirmations {
1432
+ res. push( Balance :: ClaimableAwaitingConfirmations {
1433
1433
claimable_amount_satoshis: htlc. amount_msat / 1000 ,
1434
1434
confirmation_height: conf_thresh,
1435
1435
} ) ;
1436
1436
} else {
1437
- res. push( ClaimableBalance :: ContentiousClaimable {
1437
+ res. push( Balance :: ContentiousClaimable {
1438
1438
claimable_amount_satoshis: htlc. amount_msat / 1000 ,
1439
1439
timeout_height: htlc. cltv_expiry,
1440
1440
} ) ;
@@ -1457,7 +1457,7 @@ impl<Signer: Sign> ChannelMonitor<Signer> {
1457
1457
Some ( descriptor. output . value )
1458
1458
} else { None }
1459
1459
} ) {
1460
- res. push ( ClaimableBalance :: ClaimableAwaitingConfirmations {
1460
+ res. push ( Balance :: ClaimableAwaitingConfirmations {
1461
1461
claimable_amount_satoshis : value,
1462
1462
confirmation_height : conf_thresh,
1463
1463
} ) ;
@@ -1471,7 +1471,7 @@ impl<Signer: Sign> ChannelMonitor<Signer> {
1471
1471
} else if txid == us. current_holder_commitment_tx . txid {
1472
1472
walk_htlcs ! ( true , us. current_holder_commitment_tx. htlc_outputs. iter( ) . map( |( a, _, _) | a) ) ;
1473
1473
if let Some ( conf_thresh) = pending_commitment_tx_conf_thresh {
1474
- res. push ( ClaimableBalance :: ClaimableAwaitingConfirmations {
1474
+ res. push ( Balance :: ClaimableAwaitingConfirmations {
1475
1475
claimable_amount_satoshis : us. current_holder_commitment_tx . to_self_value_sat ,
1476
1476
confirmation_height : conf_thresh,
1477
1477
} ) ;
@@ -1481,7 +1481,7 @@ impl<Signer: Sign> ChannelMonitor<Signer> {
1481
1481
if txid == prev_commitment. txid {
1482
1482
walk_htlcs ! ( true , prev_commitment. htlc_outputs. iter( ) . map( |( a, _, _) | a) ) ;
1483
1483
if let Some ( conf_thresh) = pending_commitment_tx_conf_thresh {
1484
- res. push ( ClaimableBalance :: ClaimableAwaitingConfirmations {
1484
+ res. push ( Balance :: ClaimableAwaitingConfirmations {
1485
1485
claimable_amount_satoshis : prev_commitment. to_self_value_sat ,
1486
1486
confirmation_height : conf_thresh,
1487
1487
} ) ;
@@ -1494,7 +1494,7 @@ impl<Signer: Sign> ChannelMonitor<Signer> {
1494
1494
// We blindly assume this is a cooperative close transaction here, and that
1495
1495
// neither us nor our counterparty misbehaved. At worst we've under-estimated
1496
1496
// the amount we can claim as we'll punish a misbehaving counterparty.
1497
- res. push ( ClaimableBalance :: ClaimableAwaitingConfirmations {
1497
+ res. push ( Balance :: ClaimableAwaitingConfirmations {
1498
1498
claimable_amount_satoshis : us. current_holder_commitment_tx . to_self_value_sat ,
1499
1499
confirmation_height : conf_thresh,
1500
1500
} ) ;
@@ -1507,15 +1507,15 @@ impl<Signer: Sign> ChannelMonitor<Signer> {
1507
1507
for ( htlc, _, _) in us. current_holder_commitment_tx . htlc_outputs . iter ( ) {
1508
1508
if htlc. transaction_output_index . is_none ( ) { continue ; }
1509
1509
if htlc. offered {
1510
- res. push ( ClaimableBalance :: MaybeClaimableHTLCAwaitingTimeout {
1510
+ res. push ( Balance :: MaybeClaimableHTLCAwaitingTimeout {
1511
1511
claimable_amount_satoshis : htlc. amount_msat / 1000 ,
1512
1512
claimable_height : htlc. cltv_expiry ,
1513
1513
} ) ;
1514
1514
} else if us. payment_preimages . get ( & htlc. payment_hash ) . is_some ( ) {
1515
1515
claimable_inbound_htlc_value_sat += htlc. amount_msat / 1000 ;
1516
1516
}
1517
1517
}
1518
- res. push ( ClaimableBalance :: ClaimableOnChannelClose {
1518
+ res. push ( Balance :: ClaimableOnChannelClose {
1519
1519
claimable_amount_satoshis : us. current_holder_commitment_tx . to_self_value_sat + claimable_inbound_htlc_value_sat,
1520
1520
} ) ;
1521
1521
}
@@ -2708,7 +2708,7 @@ impl<Signer: Sign> ChannelMonitorImpl<Signer> {
2708
2708
// we've already failed the HTLC as the commitment transaction
2709
2709
// which was broadcasted was revoked. In that case, we should
2710
2710
// spend the HTLC output here immediately, and expose that fact
2711
- // as a ClaimableBalance , something which we do not yet do.
2711
+ // as a Balance , something which we do not yet do.
2712
2712
// TODO: Track the above as claimable!
2713
2713
}
2714
2714
continue ' outer_loop;
0 commit comments