@@ -708,7 +708,7 @@ pub(crate) struct ChannelMonitorImpl<Signer: Sign> {
708
708
// Used to track on-chain events (i.e., transactions part of channels confirmed on chain) on
709
709
// which to take actions once they reach enough confirmations. Each entry includes the
710
710
// transaction's id and the height when the transaction was confirmed on chain.
711
- onchain_events_waiting_threshold_conf : Vec < OnchainEventEntry > ,
711
+ onchain_events_awaiting_threshold_conf : Vec < OnchainEventEntry > ,
712
712
713
713
// If we get serialized out and re-read, we need to make sure that the chain monitoring
714
714
// interface knows about the TXOs that we want to be notified of spends of. We could probably
@@ -790,7 +790,7 @@ impl<Signer: Sign> PartialEq for ChannelMonitorImpl<Signer> {
790
790
self . payment_preimages != other. payment_preimages ||
791
791
self . pending_monitor_events != other. pending_monitor_events ||
792
792
self . pending_events . len ( ) != other. pending_events . len ( ) || // We trust events to round-trip properly
793
- self . onchain_events_waiting_threshold_conf != other. onchain_events_waiting_threshold_conf ||
793
+ self . onchain_events_awaiting_threshold_conf != other. onchain_events_awaiting_threshold_conf ||
794
794
self . outputs_to_watch != other. outputs_to_watch ||
795
795
self . lockdown_from_offchain != other. lockdown_from_offchain ||
796
796
self . holder_tx_signed != other. holder_tx_signed
@@ -959,8 +959,8 @@ impl<Signer: Sign> Writeable for ChannelMonitorImpl<Signer> {
959
959
self . best_block . block_hash ( ) . write ( writer) ?;
960
960
writer. write_all ( & byte_utils:: be32_to_array ( self . best_block . height ( ) ) ) ?;
961
961
962
- writer. write_all ( & byte_utils:: be64_to_array ( self . onchain_events_waiting_threshold_conf . len ( ) as u64 ) ) ?;
963
- for ref entry in self . onchain_events_waiting_threshold_conf . iter ( ) {
962
+ writer. write_all ( & byte_utils:: be64_to_array ( self . onchain_events_awaiting_threshold_conf . len ( ) as u64 ) ) ?;
963
+ for ref entry in self . onchain_events_awaiting_threshold_conf . iter ( ) {
964
964
entry. txid . write ( writer) ?;
965
965
writer. write_all ( & byte_utils:: be32_to_array ( entry. height ) ) ?;
966
966
match entry. event {
@@ -1080,7 +1080,7 @@ impl<Signer: Sign> ChannelMonitor<Signer> {
1080
1080
pending_monitor_events : Vec :: new ( ) ,
1081
1081
pending_events : Vec :: new ( ) ,
1082
1082
1083
- onchain_events_waiting_threshold_conf : Vec :: new ( ) ,
1083
+ onchain_events_awaiting_threshold_conf : Vec :: new ( ) ,
1084
1084
outputs_to_watch,
1085
1085
1086
1086
onchain_tx_handler,
@@ -1393,7 +1393,7 @@ impl<Signer: Sign> ChannelMonitor<Signer> {
1393
1393
/// re-organization out of the chain.
1394
1394
pub fn get_relevant_txids ( & self ) -> Vec < Txid > {
1395
1395
let inner = self . inner . lock ( ) . unwrap ( ) ;
1396
- let mut txids: Vec < Txid > = inner. onchain_events_waiting_threshold_conf
1396
+ let mut txids: Vec < Txid > = inner. onchain_events_awaiting_threshold_conf
1397
1397
. iter ( )
1398
1398
. map ( |entry| entry. txid )
1399
1399
. chain ( inner. onchain_tx_handler . get_relevant_txids ( ) . into_iter ( ) )
@@ -1760,7 +1760,7 @@ impl<Signer: Sign> ChannelMonitorImpl<Signer> {
1760
1760
if let Some ( ref outpoints) = self . counterparty_claimable_outpoints. get( $txid) {
1761
1761
for & ( ref htlc, ref source_option) in outpoints. iter( ) {
1762
1762
if let & Some ( ref source) = source_option {
1763
- self . onchain_events_waiting_threshold_conf . retain( |ref entry| {
1763
+ self . onchain_events_awaiting_threshold_conf . retain( |ref entry| {
1764
1764
if entry. height != height { return true ; }
1765
1765
match entry. event {
1766
1766
OnchainEvent :: HTLCUpdate { ref htlc_update } => {
@@ -1777,7 +1777,7 @@ impl<Signer: Sign> ChannelMonitorImpl<Signer> {
1777
1777
} ,
1778
1778
} ;
1779
1779
log_info!( logger, "Failing HTLC with payment_hash {} from {} counterparty commitment tx due to broadcast of revoked counterparty commitment transaction, waiting for confirmation (at height {})" , log_bytes!( htlc. payment_hash. 0 ) , $commitment_tx, entry. confirmation_threshold( ) ) ;
1780
- self . onchain_events_waiting_threshold_conf . push( entry) ;
1780
+ self . onchain_events_awaiting_threshold_conf . push( entry) ;
1781
1781
}
1782
1782
}
1783
1783
}
@@ -1826,7 +1826,7 @@ impl<Signer: Sign> ChannelMonitorImpl<Signer> {
1826
1826
}
1827
1827
}
1828
1828
log_trace!( logger, "Failing HTLC with payment_hash {} from {} counterparty commitment tx due to broadcast of counterparty commitment transaction" , log_bytes!( htlc. payment_hash. 0 ) , $commitment_tx) ;
1829
- self . onchain_events_waiting_threshold_conf . retain( |ref entry| {
1829
+ self . onchain_events_awaiting_threshold_conf . retain( |ref entry| {
1830
1830
if entry. height != height { return true ; }
1831
1831
match entry. event {
1832
1832
OnchainEvent :: HTLCUpdate { ref htlc_update } => {
@@ -1835,7 +1835,7 @@ impl<Signer: Sign> ChannelMonitorImpl<Signer> {
1835
1835
_ => true ,
1836
1836
}
1837
1837
} ) ;
1838
- self . onchain_events_waiting_threshold_conf . push( OnchainEventEntry {
1838
+ self . onchain_events_awaiting_threshold_conf . push( OnchainEventEntry {
1839
1839
txid: * $txid,
1840
1840
height,
1841
1841
event: OnchainEvent :: HTLCUpdate {
@@ -1982,7 +1982,7 @@ impl<Signer: Sign> ChannelMonitorImpl<Signer> {
1982
1982
1983
1983
macro_rules! wait_threshold_conf {
1984
1984
( $source: expr, $commitment_tx: expr, $payment_hash: expr) => {
1985
- self . onchain_events_waiting_threshold_conf . retain( |ref entry| {
1985
+ self . onchain_events_awaiting_threshold_conf . retain( |ref entry| {
1986
1986
if entry. height != height { return true ; }
1987
1987
match entry. event {
1988
1988
OnchainEvent :: HTLCUpdate { ref htlc_update } => {
@@ -1997,7 +1997,7 @@ impl<Signer: Sign> ChannelMonitorImpl<Signer> {
1997
1997
event: OnchainEvent :: HTLCUpdate { htlc_update: ( $source, $payment_hash) } ,
1998
1998
} ;
1999
1999
log_trace!( logger, "Failing HTLC with payment_hash {} from {} holder commitment tx due to broadcast of transaction, waiting confirmation (at height{})" , log_bytes!( $payment_hash. 0 ) , $commitment_tx, entry. confirmation_threshold( ) ) ;
2000
- self . onchain_events_waiting_threshold_conf . push( entry) ;
2000
+ self . onchain_events_awaiting_threshold_conf . push( entry) ;
2001
2001
}
2002
2002
}
2003
2003
@@ -2131,7 +2131,7 @@ impl<Signer: Sign> ChannelMonitorImpl<Signer> {
2131
2131
self . block_confirmed ( height, vec ! [ ] , vec ! [ ] , vec ! [ ] , broadcaster, fee_estimator, logger)
2132
2132
} else {
2133
2133
self . best_block = BestBlock :: new ( block_hash, height) ;
2134
- self . onchain_events_waiting_threshold_conf . retain ( |ref entry| entry. height <= height) ;
2134
+ self . onchain_events_awaiting_threshold_conf . retain ( |ref entry| entry. height <= height) ;
2135
2135
self . onchain_tx_handler . block_disconnected ( height + 1 , broadcaster, fee_estimator, logger) ;
2136
2136
Vec :: new ( )
2137
2137
}
@@ -2239,20 +2239,20 @@ impl<Signer: Sign> ChannelMonitorImpl<Signer> {
2239
2239
}
2240
2240
2241
2241
// Find which on-chain events have reached their confirmation threshold.
2242
- let onchain_events_waiting_threshold_conf =
2243
- self . onchain_events_waiting_threshold_conf . drain ( ..) . collect :: < Vec < _ > > ( ) ;
2242
+ let onchain_events_awaiting_threshold_conf =
2243
+ self . onchain_events_awaiting_threshold_conf . drain ( ..) . collect :: < Vec < _ > > ( ) ;
2244
2244
let mut onchain_events_reaching_threshold_conf = Vec :: new ( ) ;
2245
- for entry in onchain_events_waiting_threshold_conf {
2245
+ for entry in onchain_events_awaiting_threshold_conf {
2246
2246
if entry. has_reached_confirmation_threshold ( height) {
2247
2247
onchain_events_reaching_threshold_conf. push ( entry) ;
2248
2248
} else {
2249
- self . onchain_events_waiting_threshold_conf . push ( entry) ;
2249
+ self . onchain_events_awaiting_threshold_conf . push ( entry) ;
2250
2250
}
2251
2251
}
2252
2252
2253
2253
// Used to check for duplicate HTLC resolutions.
2254
2254
#[ cfg( debug_assertions) ]
2255
- let unconfirmed_htlcs: Vec < _ > = self . onchain_events_waiting_threshold_conf
2255
+ let unconfirmed_htlcs: Vec < _ > = self . onchain_events_awaiting_threshold_conf
2256
2256
. iter ( )
2257
2257
. filter_map ( |entry| match & entry. event {
2258
2258
OnchainEvent :: HTLCUpdate { htlc_update } => Some ( htlc_update. 0 . clone ( ) ) ,
@@ -2323,7 +2323,7 @@ impl<Signer: Sign> ChannelMonitorImpl<Signer> {
2323
2323
//We may discard:
2324
2324
//- htlc update there as failure-trigger tx (revoked commitment tx, non-revoked commitment tx, HTLC-timeout tx) has been disconnected
2325
2325
//- maturing spendable output has transaction paying us has been disconnected
2326
- self . onchain_events_waiting_threshold_conf . retain ( |ref entry| entry. height < height) ;
2326
+ self . onchain_events_awaiting_threshold_conf . retain ( |ref entry| entry. height < height) ;
2327
2327
2328
2328
self . onchain_tx_handler . block_disconnected ( height, broadcaster, fee_estimator, logger) ;
2329
2329
@@ -2341,7 +2341,7 @@ impl<Signer: Sign> ChannelMonitorImpl<Signer> {
2341
2341
F :: Target : FeeEstimator ,
2342
2342
L :: Target : Logger ,
2343
2343
{
2344
- self . onchain_events_waiting_threshold_conf . retain ( |ref entry| entry. txid != * txid) ;
2344
+ self . onchain_events_awaiting_threshold_conf . retain ( |ref entry| entry. txid != * txid) ;
2345
2345
self . onchain_tx_handler . transaction_unconfirmed ( txid, broadcaster, fee_estimator, logger) ;
2346
2346
}
2347
2347
@@ -2570,7 +2570,7 @@ impl<Signer: Sign> ChannelMonitorImpl<Signer> {
2570
2570
} ) ) ;
2571
2571
}
2572
2572
} else {
2573
- self . onchain_events_waiting_threshold_conf . retain ( |ref entry| {
2573
+ self . onchain_events_awaiting_threshold_conf . retain ( |ref entry| {
2574
2574
if entry. height != height { return true ; }
2575
2575
match entry. event {
2576
2576
OnchainEvent :: HTLCUpdate { ref htlc_update } => {
@@ -2585,7 +2585,7 @@ impl<Signer: Sign> ChannelMonitorImpl<Signer> {
2585
2585
event : OnchainEvent :: HTLCUpdate { htlc_update : ( source, payment_hash) } ,
2586
2586
} ;
2587
2587
log_info ! ( logger, "Failing HTLC with payment_hash {} timeout by a spend tx, waiting for confirmation (at height{})" , log_bytes!( payment_hash. 0 ) , entry. confirmation_threshold( ) ) ;
2588
- self . onchain_events_waiting_threshold_conf . push ( entry) ;
2588
+ self . onchain_events_awaiting_threshold_conf . push ( entry) ;
2589
2589
}
2590
2590
}
2591
2591
}
@@ -2650,7 +2650,7 @@ impl<Signer: Sign> ChannelMonitorImpl<Signer> {
2650
2650
event : OnchainEvent :: MaturingOutput { descriptor : spendable_output. clone ( ) } ,
2651
2651
} ;
2652
2652
log_trace ! ( logger, "Maturing {} until {}" , log_spendable!( spendable_output) , entry. confirmation_threshold( ) ) ;
2653
- self . onchain_events_waiting_threshold_conf . push ( entry) ;
2653
+ self . onchain_events_awaiting_threshold_conf . push ( entry) ;
2654
2654
}
2655
2655
}
2656
2656
}
@@ -2916,7 +2916,7 @@ impl<'a, Signer: Sign, K: KeysInterface<Signer = Signer>> ReadableArgs<&'a K>
2916
2916
let best_block = BestBlock :: new ( Readable :: read ( reader) ?, Readable :: read ( reader) ?) ;
2917
2917
2918
2918
let waiting_threshold_conf_len: u64 = Readable :: read ( reader) ?;
2919
- let mut onchain_events_waiting_threshold_conf = Vec :: with_capacity ( cmp:: min ( waiting_threshold_conf_len as usize , MAX_ALLOC_SIZE / 128 ) ) ;
2919
+ let mut onchain_events_awaiting_threshold_conf = Vec :: with_capacity ( cmp:: min ( waiting_threshold_conf_len as usize , MAX_ALLOC_SIZE / 128 ) ) ;
2920
2920
for _ in 0 ..waiting_threshold_conf_len {
2921
2921
let txid = Readable :: read ( reader) ?;
2922
2922
let height = Readable :: read ( reader) ?;
@@ -2936,7 +2936,7 @@ impl<'a, Signer: Sign, K: KeysInterface<Signer = Signer>> ReadableArgs<&'a K>
2936
2936
} ,
2937
2937
_ => return Err ( DecodeError :: InvalidValue ) ,
2938
2938
} ;
2939
- onchain_events_waiting_threshold_conf . push ( OnchainEventEntry { txid, height, event } ) ;
2939
+ onchain_events_awaiting_threshold_conf . push ( OnchainEventEntry { txid, height, event } ) ;
2940
2940
}
2941
2941
2942
2942
let outputs_to_watch_len: u64 = Readable :: read ( reader) ?;
@@ -2997,7 +2997,7 @@ impl<'a, Signer: Sign, K: KeysInterface<Signer = Signer>> ReadableArgs<&'a K>
2997
2997
pending_monitor_events,
2998
2998
pending_events,
2999
2999
3000
- onchain_events_waiting_threshold_conf ,
3000
+ onchain_events_awaiting_threshold_conf ,
3001
3001
outputs_to_watch,
3002
3002
3003
3003
onchain_tx_handler,
0 commit comments