@@ -2553,28 +2553,29 @@ impl<Signer: EcdsaChannelSigner> ChannelMonitor<Signer> {
2553
2553
/// This is similar to [`Self::get_pending_or_resolved_outbound_htlcs`] except it includes
2554
2554
/// HTLCs which were resolved on-chain (i.e. where the final HTLC resolution was done by an
2555
2555
/// event from this `ChannelMonitor`).
2556
- pub ( crate ) fn get_all_current_outbound_htlcs ( & self ) -> HashMap < HTLCSource , ( HTLCOutputInCommitment , Option < PaymentPreimage > ) > {
2556
+ pub ( crate ) fn get_all_current_outbound_htlcs (
2557
+ & self ,
2558
+ ) -> HashMap < HTLCSource , ( HTLCOutputInCommitment , Option < PaymentPreimage > ) > {
2557
2559
let mut res = new_hash_map ( ) ;
2558
2560
// Just examine the available counterparty commitment transactions. See docs on
2559
2561
// `fail_unbroadcast_htlcs`, below, for justification.
2560
2562
let us = self . inner . lock ( ) . unwrap ( ) ;
2561
- macro_rules! walk_counterparty_commitment {
2562
- ( $txid: expr) => {
2563
- if let Some ( ref latest_outpoints) = us. counterparty_claimable_outpoints. get( $txid) {
2564
- for & ( ref htlc, ref source_option) in latest_outpoints. iter( ) {
2565
- if let & Some ( ref source) = source_option {
2566
- res. insert( ( * * source) . clone( ) , ( htlc. clone( ) ,
2567
- us. counterparty_fulfilled_htlcs. get( & SentHTLCId :: from_source( source) ) . cloned( ) ) ) ;
2568
- }
2563
+ let mut walk_counterparty_commitment = |txid| {
2564
+ if let Some ( latest_outpoints) = us. counterparty_claimable_outpoints . get ( txid) {
2565
+ for & ( ref htlc, ref source_option) in latest_outpoints. iter ( ) {
2566
+ if let & Some ( ref source) = source_option {
2567
+ let htlc_id = SentHTLCId :: from_source ( source) ;
2568
+ let preimage_opt = us. counterparty_fulfilled_htlcs . get ( & htlc_id) . cloned ( ) ;
2569
+ res. insert ( ( * * source) . clone ( ) , ( htlc. clone ( ) , preimage_opt) ) ;
2569
2570
}
2570
2571
}
2571
2572
}
2572
- }
2573
+ } ;
2573
2574
if let Some ( ref txid) = us. current_counterparty_commitment_txid {
2574
- walk_counterparty_commitment ! ( txid) ;
2575
+ walk_counterparty_commitment ( txid) ;
2575
2576
}
2576
2577
if let Some ( ref txid) = us. prev_counterparty_commitment_txid {
2577
- walk_counterparty_commitment ! ( txid) ;
2578
+ walk_counterparty_commitment ( txid) ;
2578
2579
}
2579
2580
res
2580
2581
}
0 commit comments