@@ -3007,29 +3007,29 @@ impl<Signer: EcdsaChannelSigner> ChannelMonitor<Signer> {
3007
3007
/// This is similar to [`Self::get_pending_or_resolved_outbound_htlcs`] except it includes
3008
3008
/// HTLCs which were resolved on-chain (i.e. where the final HTLC resolution was done by an
3009
3009
/// event from this `ChannelMonitor`).
3010
- #[ rustfmt:: skip]
3011
- pub ( crate ) fn get_all_current_outbound_htlcs ( & self ) -> HashMap < HTLCSource , ( HTLCOutputInCommitment , Option < PaymentPreimage > ) > {
3010
+ pub ( crate ) fn get_all_current_outbound_htlcs (
3011
+ & self ,
3012
+ ) -> HashMap < HTLCSource , ( HTLCOutputInCommitment , Option < PaymentPreimage > ) > {
3012
3013
let mut res = new_hash_map ( ) ;
3013
3014
// Just examine the available counterparty commitment transactions. See docs on
3014
3015
// `fail_unbroadcast_htlcs`, below, for justification.
3015
3016
let us = self . inner . lock ( ) . unwrap ( ) ;
3016
- macro_rules! walk_counterparty_commitment {
3017
- ( $txid: expr) => {
3018
- if let Some ( ref latest_outpoints) = us. funding. counterparty_claimable_outpoints. get( $txid) {
3019
- for & ( ref htlc, ref source_option) in latest_outpoints. iter( ) {
3020
- if let & Some ( ref source) = source_option {
3021
- res. insert( ( * * source) . clone( ) , ( htlc. clone( ) ,
3022
- us. counterparty_fulfilled_htlcs. get( & SentHTLCId :: from_source( source) ) . cloned( ) ) ) ;
3023
- }
3017
+ let mut walk_counterparty_commitment = |txid| {
3018
+ if let Some ( latest_outpoints) = us. funding . counterparty_claimable_outpoints . get ( txid) {
3019
+ for & ( ref htlc, ref source_option) in latest_outpoints. iter ( ) {
3020
+ if let & Some ( ref source) = source_option {
3021
+ let htlc_id = SentHTLCId :: from_source ( source) ;
3022
+ let preimage_opt = us. counterparty_fulfilled_htlcs . get ( & htlc_id) . cloned ( ) ;
3023
+ res. insert ( ( * * source) . clone ( ) , ( htlc. clone ( ) , preimage_opt) ) ;
3024
3024
}
3025
3025
}
3026
3026
}
3027
- }
3027
+ } ;
3028
3028
if let Some ( ref txid) = us. funding . current_counterparty_commitment_txid {
3029
- walk_counterparty_commitment ! ( txid) ;
3029
+ walk_counterparty_commitment ( txid) ;
3030
3030
}
3031
3031
if let Some ( ref txid) = us. funding . prev_counterparty_commitment_txid {
3032
- walk_counterparty_commitment ! ( txid) ;
3032
+ walk_counterparty_commitment ( txid) ;
3033
3033
}
3034
3034
res
3035
3035
}
0 commit comments