@@ -485,7 +485,7 @@ struct ClaimablePayments {
485
485
///
486
486
/// When adding to the map, [`Self::pending_claiming_payments`] must also be checked to ensure
487
487
/// we don't get a duplicate payment.
488
- claimable_htlcs : HashMap < PaymentHash , ClaimablePayment > ,
488
+ claimable_payments : HashMap < PaymentHash , ClaimablePayment > ,
489
489
490
490
/// Map from payment hash to the payment data for HTLCs which we have begun claiming, but which
491
491
/// are waiting on a [`ChannelMonitorUpdate`] to complete in order to be surfaced to the user
@@ -1673,7 +1673,7 @@ where
1673
1673
pending_inbound_payments : Mutex :: new ( HashMap :: new ( ) ) ,
1674
1674
pending_outbound_payments : OutboundPayments :: new ( ) ,
1675
1675
forward_htlcs : Mutex :: new ( HashMap :: new ( ) ) ,
1676
- claimable_payments : Mutex :: new ( ClaimablePayments { claimable_htlcs : HashMap :: new ( ) , pending_claiming_payments : HashMap :: new ( ) } ) ,
1676
+ claimable_payments : Mutex :: new ( ClaimablePayments { claimable_payments : HashMap :: new ( ) , pending_claiming_payments : HashMap :: new ( ) } ) ,
1677
1677
pending_intercepted_htlcs : Mutex :: new ( HashMap :: new ( ) ) ,
1678
1678
id_to_peer : Mutex :: new ( HashMap :: new ( ) ) ,
1679
1679
short_to_chan_info : FairRwLock :: new ( HashMap :: new ( ) ) ,
@@ -3354,7 +3354,7 @@ where
3354
3354
fail_htlc!( claimable_htlc, payment_hash) ;
3355
3355
continue
3356
3356
}
3357
- let ref mut claimable_payment = claimable_payments. claimable_htlcs
3357
+ let ref mut claimable_payment = claimable_payments. claimable_payments
3358
3358
. entry( payment_hash)
3359
3359
// Note that if we insert here we MUST NOT fail_htlc!()
3360
3360
. or_insert_with( || ClaimablePayment {
@@ -3455,7 +3455,7 @@ where
3455
3455
fail_htlc ! ( claimable_htlc, payment_hash) ;
3456
3456
continue
3457
3457
}
3458
- match claimable_payments. claimable_htlcs . entry ( payment_hash) {
3458
+ match claimable_payments. claimable_payments . entry ( payment_hash) {
3459
3459
hash_map:: Entry :: Vacant ( e) => {
3460
3460
let amount_msat = claimable_htlc. value ;
3461
3461
claimable_htlc. total_value_received = Some ( amount_msat) ;
@@ -3721,7 +3721,7 @@ where
3721
3721
}
3722
3722
}
3723
3723
3724
- self . claimable_payments . lock ( ) . unwrap ( ) . claimable_htlcs . retain ( |payment_hash, payment| {
3724
+ self . claimable_payments . lock ( ) . unwrap ( ) . claimable_payments . retain ( |payment_hash, payment| {
3725
3725
if payment. htlcs . is_empty ( ) {
3726
3726
// This should be unreachable
3727
3727
debug_assert ! ( false ) ;
@@ -3796,7 +3796,7 @@ where
3796
3796
pub fn fail_htlc_backwards_with_reason ( & self , payment_hash : & PaymentHash , failure_code : FailureCode ) {
3797
3797
let _persistence_guard = PersistenceNotifierGuard :: notify_on_drop ( & self . total_consistency_lock , & self . persistence_notifier ) ;
3798
3798
3799
- let removed_source = self . claimable_payments . lock ( ) . unwrap ( ) . claimable_htlcs . remove ( payment_hash) ;
3799
+ let removed_source = self . claimable_payments . lock ( ) . unwrap ( ) . claimable_payments . remove ( payment_hash) ;
3800
3800
if let Some ( payment) = removed_source {
3801
3801
for htlc in payment. htlcs {
3802
3802
let reason = self . get_htlc_fail_reason_from_failure_code ( failure_code, & htlc) ;
@@ -3975,7 +3975,7 @@ where
3975
3975
3976
3976
let mut sources = {
3977
3977
let mut claimable_payments = self . claimable_payments . lock ( ) . unwrap ( ) ;
3978
- if let Some ( payment) = claimable_payments. claimable_htlcs . remove ( & payment_hash) {
3978
+ if let Some ( payment) = claimable_payments. claimable_payments . remove ( & payment_hash) {
3979
3979
let mut receiver_node_id = self . our_network_pubkey ;
3980
3980
for htlc in payment. htlcs . iter ( ) {
3981
3981
if htlc. prev_hop . phantom_shared_secret . is_some ( ) {
@@ -6107,7 +6107,7 @@ where
6107
6107
}
6108
6108
6109
6109
if let Some ( height) = height_opt {
6110
- self . claimable_payments . lock ( ) . unwrap ( ) . claimable_htlcs . retain ( |payment_hash, payment| {
6110
+ self . claimable_payments . lock ( ) . unwrap ( ) . claimable_payments . retain ( |payment_hash, payment| {
6111
6111
payment. htlcs . retain ( |htlc| {
6112
6112
// If height is approaching the number of blocks we think it takes us to get
6113
6113
// our commitment transaction confirmed before the HTLC expires, plus the
@@ -7044,8 +7044,8 @@ where
7044
7044
let pending_outbound_payments = self . pending_outbound_payments . pending_outbound_payments . lock ( ) . unwrap ( ) ;
7045
7045
7046
7046
let mut htlc_purposes: Vec < & events:: PaymentPurpose > = Vec :: new ( ) ;
7047
- ( claimable_payments. claimable_htlcs . len ( ) as u64 ) . write ( writer) ?;
7048
- for ( payment_hash, payment) in claimable_payments. claimable_htlcs . iter ( ) {
7047
+ ( claimable_payments. claimable_payments . len ( ) as u64 ) . write ( writer) ?;
7048
+ for ( payment_hash, payment) in claimable_payments. claimable_payments . iter ( ) {
7049
7049
payment_hash. write ( writer) ?;
7050
7050
( payment. htlcs . len ( ) as u64 ) . write ( writer) ?;
7051
7051
for htlc in payment. htlcs . iter ( ) {
@@ -7704,13 +7704,13 @@ where
7704
7704
let inbound_pmt_key_material = args. node_signer . get_inbound_payment_key_material ( ) ;
7705
7705
let expanded_inbound_key = inbound_payment:: ExpandedKey :: new ( & inbound_pmt_key_material) ;
7706
7706
7707
- let mut claimable_htlcs = HashMap :: with_capacity ( claimable_htlcs_list. len ( ) ) ;
7707
+ let mut claimable_payments = HashMap :: with_capacity ( claimable_htlcs_list. len ( ) ) ;
7708
7708
if let Some ( mut purposes) = claimable_htlc_purposes {
7709
7709
if purposes. len ( ) != claimable_htlcs_list. len ( ) {
7710
7710
return Err ( DecodeError :: InvalidValue ) ;
7711
7711
}
7712
7712
for ( purpose, ( payment_hash, htlcs) ) in purposes. drain ( ..) . zip ( claimable_htlcs_list. drain ( ..) ) {
7713
- let existing_payment = claimable_htlcs . insert ( payment_hash, ClaimablePayment {
7713
+ let existing_payment = claimable_payments . insert ( payment_hash, ClaimablePayment {
7714
7714
purpose, htlcs,
7715
7715
} ) ;
7716
7716
if existing_payment. is_some ( ) { return Err ( DecodeError :: InvalidValue ) ; }
@@ -7743,7 +7743,7 @@ where
7743
7743
OnionPayload :: Spontaneous ( payment_preimage) =>
7744
7744
events:: PaymentPurpose :: SpontaneousPayment ( * payment_preimage) ,
7745
7745
} ;
7746
- claimable_htlcs . insert ( payment_hash, ClaimablePayment {
7746
+ claimable_payments . insert ( payment_hash, ClaimablePayment {
7747
7747
purpose, htlcs,
7748
7748
} ) ;
7749
7749
}
@@ -7797,7 +7797,7 @@ where
7797
7797
7798
7798
for ( _, monitor) in args. channel_monitors . iter ( ) {
7799
7799
for ( payment_hash, payment_preimage) in monitor. get_stored_preimages ( ) {
7800
- if let Some ( payment) = claimable_htlcs . remove ( & payment_hash) {
7800
+ if let Some ( payment) = claimable_payments . remove ( & payment_hash) {
7801
7801
log_info ! ( args. logger, "Re-claiming HTLCs with payment hash {} as we've released the preimage to a ChannelMonitor!" , log_bytes!( payment_hash. 0 ) ) ;
7802
7802
let mut claimable_amt_msat = 0 ;
7803
7803
let mut receiver_node_id = Some ( our_network_pubkey) ;
@@ -7872,7 +7872,7 @@ where
7872
7872
pending_intercepted_htlcs : Mutex :: new ( pending_intercepted_htlcs. unwrap ( ) ) ,
7873
7873
7874
7874
forward_htlcs : Mutex :: new ( forward_htlcs) ,
7875
- claimable_payments : Mutex :: new ( ClaimablePayments { claimable_htlcs , pending_claiming_payments : pending_claiming_payments. unwrap ( ) } ) ,
7875
+ claimable_payments : Mutex :: new ( ClaimablePayments { claimable_payments , pending_claiming_payments : pending_claiming_payments. unwrap ( ) } ) ,
7876
7876
outbound_scid_aliases : Mutex :: new ( outbound_scid_aliases) ,
7877
7877
id_to_peer : Mutex :: new ( id_to_peer) ,
7878
7878
short_to_chan_info : FairRwLock :: new ( short_to_chan_info) ,
0 commit comments