@@ -2930,29 +2930,29 @@ impl<Signer: EcdsaChannelSigner> ChannelMonitor<Signer> {
2930
2930
/// This is similar to [`Self::get_pending_or_resolved_outbound_htlcs`] except it includes
2931
2931
/// HTLCs which were resolved on-chain (i.e. where the final HTLC resolution was done by an
2932
2932
/// event from this `ChannelMonitor`).
2933
- #[ rustfmt:: skip]
2934
- pub ( crate ) fn get_all_current_outbound_htlcs ( & self ) -> HashMap < HTLCSource , ( HTLCOutputInCommitment , Option < PaymentPreimage > ) > {
2933
+ pub ( crate ) fn get_all_current_outbound_htlcs (
2934
+ & self ,
2935
+ ) -> HashMap < HTLCSource , ( HTLCOutputInCommitment , Option < PaymentPreimage > ) > {
2935
2936
let mut res = new_hash_map ( ) ;
2936
2937
// Just examine the available counterparty commitment transactions. See docs on
2937
2938
// `fail_unbroadcast_htlcs`, below, for justification.
2938
2939
let us = self . inner . lock ( ) . unwrap ( ) ;
2939
- macro_rules! walk_counterparty_commitment {
2940
- ( $txid: expr) => {
2941
- if let Some ( ref latest_outpoints) = us. funding. counterparty_claimable_outpoints. get( $txid) {
2942
- for & ( ref htlc, ref source_option) in latest_outpoints. iter( ) {
2943
- if let & Some ( ref source) = source_option {
2944
- res. insert( ( * * source) . clone( ) , ( htlc. clone( ) ,
2945
- us. counterparty_fulfilled_htlcs. get( & SentHTLCId :: from_source( source) ) . cloned( ) ) ) ;
2946
- }
2940
+ let mut walk_counterparty_commitment = |txid| {
2941
+ if let Some ( latest_outpoints) = us. funding . counterparty_claimable_outpoints . get ( txid) {
2942
+ for & ( ref htlc, ref source_option) in latest_outpoints. iter ( ) {
2943
+ if let & Some ( ref source) = source_option {
2944
+ let htlc_id = SentHTLCId :: from_source ( source) ;
2945
+ let preimage_opt = us. counterparty_fulfilled_htlcs . get ( & htlc_id) . cloned ( ) ;
2946
+ res. insert ( ( * * source) . clone ( ) , ( htlc. clone ( ) , preimage_opt) ) ;
2947
2947
}
2948
2948
}
2949
2949
}
2950
- }
2950
+ } ;
2951
2951
if let Some ( ref txid) = us. funding . current_counterparty_commitment_txid {
2952
- walk_counterparty_commitment ! ( txid) ;
2952
+ walk_counterparty_commitment ( txid) ;
2953
2953
}
2954
2954
if let Some ( ref txid) = us. funding . prev_counterparty_commitment_txid {
2955
- walk_counterparty_commitment ! ( txid) ;
2955
+ walk_counterparty_commitment ( txid) ;
2956
2956
}
2957
2957
res
2958
2958
}
0 commit comments