@@ -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 ( ) ) ,
@@ -2332,7 +2332,7 @@ impl<Signer: Sign> ChannelMonitorImpl<Signer> {
2332
2332
//We may discard:
2333
2333
//- htlc update there as failure-trigger tx (revoked commitment tx, non-revoked commitment tx, HTLC-timeout tx) has been disconnected
2334
2334
//- maturing spendable output has transaction paying us has been disconnected
2335
- self . onchain_events_waiting_threshold_conf . retain ( |ref entry| entry. height < height) ;
2335
+ self . onchain_events_awaiting_threshold_conf . retain ( |ref entry| entry. height < height) ;
2336
2336
2337
2337
self . onchain_tx_handler . block_disconnected ( height, broadcaster, fee_estimator, logger) ;
2338
2338
@@ -2350,7 +2350,7 @@ impl<Signer: Sign> ChannelMonitorImpl<Signer> {
2350
2350
F :: Target : FeeEstimator ,
2351
2351
L :: Target : Logger ,
2352
2352
{
2353
- self . onchain_events_waiting_threshold_conf . retain ( |ref entry| entry. txid != * txid) ;
2353
+ self . onchain_events_awaiting_threshold_conf . retain ( |ref entry| entry. txid != * txid) ;
2354
2354
self . onchain_tx_handler . transaction_unconfirmed ( txid, broadcaster, fee_estimator, logger) ;
2355
2355
}
2356
2356
@@ -2579,7 +2579,7 @@ impl<Signer: Sign> ChannelMonitorImpl<Signer> {
2579
2579
} ) ) ;
2580
2580
}
2581
2581
} else {
2582
- self . onchain_events_waiting_threshold_conf . retain ( |ref entry| {
2582
+ self . onchain_events_awaiting_threshold_conf . retain ( |ref entry| {
2583
2583
if entry. height != height { return true ; }
2584
2584
match entry. event {
2585
2585
OnchainEvent :: HTLCUpdate { ref htlc_update } => {
@@ -2594,7 +2594,7 @@ impl<Signer: Sign> ChannelMonitorImpl<Signer> {
2594
2594
event : OnchainEvent :: HTLCUpdate { htlc_update : ( source, payment_hash) } ,
2595
2595
} ;
2596
2596
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( ) ) ;
2597
- self . onchain_events_waiting_threshold_conf . push ( entry) ;
2597
+ self . onchain_events_awaiting_threshold_conf . push ( entry) ;
2598
2598
}
2599
2599
}
2600
2600
}
@@ -2659,7 +2659,7 @@ impl<Signer: Sign> ChannelMonitorImpl<Signer> {
2659
2659
event : OnchainEvent :: MaturingOutput { descriptor : spendable_output. clone ( ) } ,
2660
2660
} ;
2661
2661
log_trace ! ( logger, "Maturing {} until {}" , log_spendable!( spendable_output) , entry. confirmation_threshold( ) ) ;
2662
- self . onchain_events_waiting_threshold_conf . push ( entry) ;
2662
+ self . onchain_events_awaiting_threshold_conf . push ( entry) ;
2663
2663
}
2664
2664
}
2665
2665
}
@@ -2925,7 +2925,7 @@ impl<'a, Signer: Sign, K: KeysInterface<Signer = Signer>> ReadableArgs<&'a K>
2925
2925
let best_block = BestBlock :: new ( Readable :: read ( reader) ?, Readable :: read ( reader) ?) ;
2926
2926
2927
2927
let waiting_threshold_conf_len: u64 = Readable :: read ( reader) ?;
2928
- let mut onchain_events_waiting_threshold_conf = Vec :: with_capacity ( cmp:: min ( waiting_threshold_conf_len as usize , MAX_ALLOC_SIZE / 128 ) ) ;
2928
+ let mut onchain_events_awaiting_threshold_conf = Vec :: with_capacity ( cmp:: min ( waiting_threshold_conf_len as usize , MAX_ALLOC_SIZE / 128 ) ) ;
2929
2929
for _ in 0 ..waiting_threshold_conf_len {
2930
2930
let txid = Readable :: read ( reader) ?;
2931
2931
let height = Readable :: read ( reader) ?;
@@ -2945,7 +2945,7 @@ impl<'a, Signer: Sign, K: KeysInterface<Signer = Signer>> ReadableArgs<&'a K>
2945
2945
} ,
2946
2946
_ => return Err ( DecodeError :: InvalidValue ) ,
2947
2947
} ;
2948
- onchain_events_waiting_threshold_conf . push ( OnchainEventEntry { txid, height, event } ) ;
2948
+ onchain_events_awaiting_threshold_conf . push ( OnchainEventEntry { txid, height, event } ) ;
2949
2949
}
2950
2950
2951
2951
let outputs_to_watch_len: u64 = Readable :: read ( reader) ?;
@@ -3006,7 +3006,7 @@ impl<'a, Signer: Sign, K: KeysInterface<Signer = Signer>> ReadableArgs<&'a K>
3006
3006
pending_monitor_events,
3007
3007
pending_events,
3008
3008
3009
- onchain_events_waiting_threshold_conf ,
3009
+ onchain_events_awaiting_threshold_conf ,
3010
3010
outputs_to_watch,
3011
3011
3012
3012
onchain_tx_handler,
0 commit comments