@@ -2907,29 +2907,29 @@ impl<Signer: EcdsaChannelSigner> ChannelMonitor<Signer> {
2907
2907
/// This is similar to [`Self::get_pending_or_resolved_outbound_htlcs`] except it includes
2908
2908
/// HTLCs which were resolved on-chain (i.e. where the final HTLC resolution was done by an
2909
2909
/// event from this `ChannelMonitor`).
2910
- #[ rustfmt:: skip]
2911
- pub ( crate ) fn get_all_current_outbound_htlcs ( & self ) -> HashMap < HTLCSource , ( HTLCOutputInCommitment , Option < PaymentPreimage > ) > {
2910
+ pub ( crate ) fn get_all_current_outbound_htlcs (
2911
+ & self ,
2912
+ ) -> HashMap < HTLCSource , ( HTLCOutputInCommitment , Option < PaymentPreimage > ) > {
2912
2913
let mut res = new_hash_map ( ) ;
2913
2914
// Just examine the available counterparty commitment transactions. See docs on
2914
2915
// `fail_unbroadcast_htlcs`, below, for justification.
2915
2916
let us = self . inner . lock ( ) . unwrap ( ) ;
2916
- macro_rules! walk_counterparty_commitment {
2917
- ( $txid: expr) => {
2918
- if let Some ( ref latest_outpoints) = us. funding. counterparty_claimable_outpoints. get( $txid) {
2919
- for & ( ref htlc, ref source_option) in latest_outpoints. iter( ) {
2920
- if let & Some ( ref source) = source_option {
2921
- res. insert( ( * * source) . clone( ) , ( htlc. clone( ) ,
2922
- us. counterparty_fulfilled_htlcs. get( & SentHTLCId :: from_source( source) ) . cloned( ) ) ) ;
2923
- }
2917
+ let mut walk_counterparty_commitment = |txid| {
2918
+ if let Some ( latest_outpoints) = us. funding . counterparty_claimable_outpoints . get ( txid) {
2919
+ for & ( ref htlc, ref source_option) in latest_outpoints. iter ( ) {
2920
+ if let & Some ( ref source) = source_option {
2921
+ let htlc_id = SentHTLCId :: from_source ( source) ;
2922
+ let preimage_opt = us. counterparty_fulfilled_htlcs . get ( & htlc_id) . cloned ( ) ;
2923
+ res. insert ( ( * * source) . clone ( ) , ( htlc. clone ( ) , preimage_opt) ) ;
2924
2924
}
2925
2925
}
2926
2926
}
2927
- }
2927
+ } ;
2928
2928
if let Some ( ref txid) = us. funding . current_counterparty_commitment_txid {
2929
- walk_counterparty_commitment ! ( txid) ;
2929
+ walk_counterparty_commitment ( txid) ;
2930
2930
}
2931
2931
if let Some ( ref txid) = us. funding . prev_counterparty_commitment_txid {
2932
- walk_counterparty_commitment ! ( txid) ;
2932
+ walk_counterparty_commitment ( txid) ;
2933
2933
}
2934
2934
res
2935
2935
}
0 commit comments