@@ -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,
@@ -1392,7 +1392,7 @@ impl<Signer: Sign> ChannelMonitor<Signer> {
1392
1392
/// Returns the set of txids that should be monitored for re-organization out of the chain.
1393
1393
pub fn get_relevant_txids ( & self ) -> Vec < Txid > {
1394
1394
let inner = self . inner . lock ( ) . unwrap ( ) ;
1395
- let mut txids: Vec < Txid > = inner. onchain_events_waiting_threshold_conf
1395
+ let mut txids: Vec < Txid > = inner. onchain_events_awaiting_threshold_conf
1396
1396
. iter ( )
1397
1397
. map ( |entry| entry. txid )
1398
1398
. chain ( inner. onchain_tx_handler . get_relevant_txids ( ) . into_iter ( ) )
@@ -1759,7 +1759,7 @@ impl<Signer: Sign> ChannelMonitorImpl<Signer> {
1759
1759
if let Some ( ref outpoints) = self . counterparty_claimable_outpoints. get( $txid) {
1760
1760
for & ( ref htlc, ref source_option) in outpoints. iter( ) {
1761
1761
if let & Some ( ref source) = source_option {
1762
- self . onchain_events_waiting_threshold_conf . retain( |ref entry| {
1762
+ self . onchain_events_awaiting_threshold_conf . retain( |ref entry| {
1763
1763
if entry. height != height { return true ; }
1764
1764
match entry. event {
1765
1765
OnchainEvent :: HTLCUpdate { ref htlc_update } => {
@@ -1776,7 +1776,7 @@ impl<Signer: Sign> ChannelMonitorImpl<Signer> {
1776
1776
} ,
1777
1777
} ;
1778
1778
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( ) ) ;
1779
- self . onchain_events_waiting_threshold_conf . push( entry) ;
1779
+ self . onchain_events_awaiting_threshold_conf . push( entry) ;
1780
1780
}
1781
1781
}
1782
1782
}
@@ -1825,7 +1825,7 @@ impl<Signer: Sign> ChannelMonitorImpl<Signer> {
1825
1825
}
1826
1826
}
1827
1827
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) ;
1828
- self . onchain_events_waiting_threshold_conf . retain( |ref entry| {
1828
+ self . onchain_events_awaiting_threshold_conf . retain( |ref entry| {
1829
1829
if entry. height != height { return true ; }
1830
1830
match entry. event {
1831
1831
OnchainEvent :: HTLCUpdate { ref htlc_update } => {
@@ -1834,7 +1834,7 @@ impl<Signer: Sign> ChannelMonitorImpl<Signer> {
1834
1834
_ => true ,
1835
1835
}
1836
1836
} ) ;
1837
- self . onchain_events_waiting_threshold_conf . push( OnchainEventEntry {
1837
+ self . onchain_events_awaiting_threshold_conf . push( OnchainEventEntry {
1838
1838
txid: * $txid,
1839
1839
height,
1840
1840
event: OnchainEvent :: HTLCUpdate {
@@ -1981,7 +1981,7 @@ impl<Signer: Sign> ChannelMonitorImpl<Signer> {
1981
1981
1982
1982
macro_rules! wait_threshold_conf {
1983
1983
( $source: expr, $commitment_tx: expr, $payment_hash: expr) => {
1984
- self . onchain_events_waiting_threshold_conf . retain( |ref entry| {
1984
+ self . onchain_events_awaiting_threshold_conf . retain( |ref entry| {
1985
1985
if entry. height != height { return true ; }
1986
1986
match entry. event {
1987
1987
OnchainEvent :: HTLCUpdate { ref htlc_update } => {
@@ -1996,7 +1996,7 @@ impl<Signer: Sign> ChannelMonitorImpl<Signer> {
1996
1996
event: OnchainEvent :: HTLCUpdate { htlc_update: ( $source, $payment_hash) } ,
1997
1997
} ;
1998
1998
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( ) ) ;
1999
- self . onchain_events_waiting_threshold_conf . push( entry) ;
1999
+ self . onchain_events_awaiting_threshold_conf . push( entry) ;
2000
2000
}
2001
2001
}
2002
2002
@@ -2130,7 +2130,7 @@ impl<Signer: Sign> ChannelMonitorImpl<Signer> {
2130
2130
self . block_confirmed ( height, vec ! [ ] , vec ! [ ] , vec ! [ ] , broadcaster, fee_estimator, logger)
2131
2131
} else {
2132
2132
self . best_block = BestBlock :: new ( block_hash, height) ;
2133
- self . onchain_events_waiting_threshold_conf . retain ( |ref entry| entry. height <= height) ;
2133
+ self . onchain_events_awaiting_threshold_conf . retain ( |ref entry| entry. height <= height) ;
2134
2134
self . onchain_tx_handler . block_disconnected ( height + 1 , broadcaster, fee_estimator, logger) ;
2135
2135
Vec :: new ( )
2136
2136
}
@@ -2238,20 +2238,20 @@ impl<Signer: Sign> ChannelMonitorImpl<Signer> {
2238
2238
}
2239
2239
2240
2240
// Find which on-chain events have reached their confirmation threshold.
2241
- let onchain_events_waiting_threshold_conf =
2242
- self . onchain_events_waiting_threshold_conf . drain ( ..) . collect :: < Vec < _ > > ( ) ;
2241
+ let onchain_events_awaiting_threshold_conf =
2242
+ self . onchain_events_awaiting_threshold_conf . drain ( ..) . collect :: < Vec < _ > > ( ) ;
2243
2243
let mut onchain_events_reaching_threshold_conf = Vec :: new ( ) ;
2244
- for entry in onchain_events_waiting_threshold_conf {
2244
+ for entry in onchain_events_awaiting_threshold_conf {
2245
2245
if entry. has_reached_confirmation_threshold ( height) {
2246
2246
onchain_events_reaching_threshold_conf. push ( entry) ;
2247
2247
} else {
2248
- self . onchain_events_waiting_threshold_conf . push ( entry) ;
2248
+ self . onchain_events_awaiting_threshold_conf . push ( entry) ;
2249
2249
}
2250
2250
}
2251
2251
2252
2252
// Used to check for duplicate HTLC resolutions.
2253
2253
#[ cfg( debug_assertions) ]
2254
- let unmatured_htlcs: Vec < _ > = self . onchain_events_waiting_threshold_conf
2254
+ let unmatured_htlcs: Vec < _ > = self . onchain_events_awaiting_threshold_conf
2255
2255
. iter ( )
2256
2256
. filter_map ( |entry| match & entry. event {
2257
2257
OnchainEvent :: HTLCUpdate { htlc_update } => Some ( htlc_update. 0 . clone ( ) ) ,
@@ -2330,7 +2330,7 @@ impl<Signer: Sign> ChannelMonitorImpl<Signer> {
2330
2330
//We may discard:
2331
2331
//- htlc update there as failure-trigger tx (revoked commitment tx, non-revoked commitment tx, HTLC-timeout tx) has been disconnected
2332
2332
//- maturing spendable output has transaction paying us has been disconnected
2333
- self . onchain_events_waiting_threshold_conf . retain ( |ref entry| entry. height < height) ;
2333
+ self . onchain_events_awaiting_threshold_conf . retain ( |ref entry| entry. height < height) ;
2334
2334
2335
2335
self . onchain_tx_handler . block_disconnected ( height, broadcaster, fee_estimator, logger) ;
2336
2336
@@ -2348,7 +2348,7 @@ impl<Signer: Sign> ChannelMonitorImpl<Signer> {
2348
2348
F :: Target : FeeEstimator ,
2349
2349
L :: Target : Logger ,
2350
2350
{
2351
- self . onchain_events_waiting_threshold_conf . retain ( |ref entry| entry. txid != * txid) ;
2351
+ self . onchain_events_awaiting_threshold_conf . retain ( |ref entry| entry. txid != * txid) ;
2352
2352
self . onchain_tx_handler . transaction_unconfirmed ( txid, broadcaster, fee_estimator, logger) ;
2353
2353
}
2354
2354
@@ -2577,7 +2577,7 @@ impl<Signer: Sign> ChannelMonitorImpl<Signer> {
2577
2577
} ) ) ;
2578
2578
}
2579
2579
} else {
2580
- self . onchain_events_waiting_threshold_conf . retain ( |ref entry| {
2580
+ self . onchain_events_awaiting_threshold_conf . retain ( |ref entry| {
2581
2581
if entry. height != height { return true ; }
2582
2582
match entry. event {
2583
2583
OnchainEvent :: HTLCUpdate { ref htlc_update } => {
@@ -2592,7 +2592,7 @@ impl<Signer: Sign> ChannelMonitorImpl<Signer> {
2592
2592
event : OnchainEvent :: HTLCUpdate { htlc_update : ( source, payment_hash) } ,
2593
2593
} ;
2594
2594
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( ) ) ;
2595
- self . onchain_events_waiting_threshold_conf . push ( entry) ;
2595
+ self . onchain_events_awaiting_threshold_conf . push ( entry) ;
2596
2596
}
2597
2597
}
2598
2598
}
@@ -2657,7 +2657,7 @@ impl<Signer: Sign> ChannelMonitorImpl<Signer> {
2657
2657
event : OnchainEvent :: MaturingOutput { descriptor : spendable_output. clone ( ) } ,
2658
2658
} ;
2659
2659
log_trace ! ( logger, "Maturing {} until {}" , log_spendable!( spendable_output) , entry. confirmation_threshold( ) ) ;
2660
- self . onchain_events_waiting_threshold_conf . push ( entry) ;
2660
+ self . onchain_events_awaiting_threshold_conf . push ( entry) ;
2661
2661
}
2662
2662
}
2663
2663
}
@@ -2923,7 +2923,7 @@ impl<'a, Signer: Sign, K: KeysInterface<Signer = Signer>> ReadableArgs<&'a K>
2923
2923
let best_block = BestBlock :: new ( Readable :: read ( reader) ?, Readable :: read ( reader) ?) ;
2924
2924
2925
2925
let waiting_threshold_conf_len: u64 = Readable :: read ( reader) ?;
2926
- let mut onchain_events_waiting_threshold_conf = Vec :: with_capacity ( cmp:: min ( waiting_threshold_conf_len as usize , MAX_ALLOC_SIZE / 128 ) ) ;
2926
+ let mut onchain_events_awaiting_threshold_conf = Vec :: with_capacity ( cmp:: min ( waiting_threshold_conf_len as usize , MAX_ALLOC_SIZE / 128 ) ) ;
2927
2927
for _ in 0 ..waiting_threshold_conf_len {
2928
2928
let txid = Readable :: read ( reader) ?;
2929
2929
let height = Readable :: read ( reader) ?;
@@ -2943,7 +2943,7 @@ impl<'a, Signer: Sign, K: KeysInterface<Signer = Signer>> ReadableArgs<&'a K>
2943
2943
} ,
2944
2944
_ => return Err ( DecodeError :: InvalidValue ) ,
2945
2945
} ;
2946
- onchain_events_waiting_threshold_conf . push ( OnchainEventEntry { txid, height, event } ) ;
2946
+ onchain_events_awaiting_threshold_conf . push ( OnchainEventEntry { txid, height, event } ) ;
2947
2947
}
2948
2948
2949
2949
let outputs_to_watch_len: u64 = Readable :: read ( reader) ?;
@@ -3004,7 +3004,7 @@ impl<'a, Signer: Sign, K: KeysInterface<Signer = Signer>> ReadableArgs<&'a K>
3004
3004
pending_monitor_events,
3005
3005
pending_events,
3006
3006
3007
- onchain_events_waiting_threshold_conf ,
3007
+ onchain_events_awaiting_threshold_conf ,
3008
3008
outputs_to_watch,
3009
3009
3010
3010
onchain_tx_handler,
0 commit comments