@@ -2956,29 +2956,29 @@ impl<Signer: EcdsaChannelSigner> ChannelMonitor<Signer> {
2956
2956
/// This is similar to [`Self::get_pending_or_resolved_outbound_htlcs`] except it includes
2957
2957
/// HTLCs which were resolved on-chain (i.e. where the final HTLC resolution was done by an
2958
2958
/// event from this `ChannelMonitor`).
2959
- #[ rustfmt:: skip]
2960
- pub ( crate ) fn get_all_current_outbound_htlcs ( & self ) -> HashMap < HTLCSource , ( HTLCOutputInCommitment , Option < PaymentPreimage > ) > {
2959
+ pub ( crate ) fn get_all_current_outbound_htlcs (
2960
+ & self ,
2961
+ ) -> HashMap < HTLCSource , ( HTLCOutputInCommitment , Option < PaymentPreimage > ) > {
2961
2962
let mut res = new_hash_map ( ) ;
2962
2963
// Just examine the available counterparty commitment transactions. See docs on
2963
2964
// `fail_unbroadcast_htlcs`, below, for justification.
2964
2965
let us = self . inner . lock ( ) . unwrap ( ) ;
2965
- macro_rules! walk_counterparty_commitment {
2966
- ( $txid: expr) => {
2967
- if let Some ( ref latest_outpoints) = us. funding. counterparty_claimable_outpoints. get( $txid) {
2968
- for & ( ref htlc, ref source_option) in latest_outpoints. iter( ) {
2969
- if let & Some ( ref source) = source_option {
2970
- res. insert( ( * * source) . clone( ) , ( htlc. clone( ) ,
2971
- us. counterparty_fulfilled_htlcs. get( & SentHTLCId :: from_source( source) ) . cloned( ) ) ) ;
2972
- }
2966
+ let mut walk_counterparty_commitment = |txid| {
2967
+ if let Some ( latest_outpoints) = us. funding . counterparty_claimable_outpoints . get ( txid) {
2968
+ for & ( ref htlc, ref source_option) in latest_outpoints. iter ( ) {
2969
+ if let & Some ( ref source) = source_option {
2970
+ let htlc_id = SentHTLCId :: from_source ( source) ;
2971
+ let preimage_opt = us. counterparty_fulfilled_htlcs . get ( & htlc_id) . cloned ( ) ;
2972
+ res. insert ( ( * * source) . clone ( ) , ( htlc. clone ( ) , preimage_opt) ) ;
2973
2973
}
2974
2974
}
2975
2975
}
2976
- }
2976
+ } ;
2977
2977
if let Some ( ref txid) = us. funding . current_counterparty_commitment_txid {
2978
- walk_counterparty_commitment ! ( txid) ;
2978
+ walk_counterparty_commitment ( txid) ;
2979
2979
}
2980
2980
if let Some ( ref txid) = us. funding . prev_counterparty_commitment_txid {
2981
- walk_counterparty_commitment ! ( txid) ;
2981
+ walk_counterparty_commitment ( txid) ;
2982
2982
}
2983
2983
res
2984
2984
}
0 commit comments