Merge pull request #2101 from TheBlueMatt/2023-03-one-less-sig
authorMatt Corallo <649246+TheBlueMatt@users.noreply.github.com>
Thu, 6 Apr 2023 18:07:55 +0000 (18:07 +0000)
committerGitHub <noreply@github.com>
Thu, 6 Apr 2023 18:07:55 +0000 (18:07 +0000)
Support future removal of redundant per-HTLC signatures in `CMU`s

1  2 
lightning/src/chain/channelmonitor.rs
lightning/src/ln/chan_utils.rs
lightning/src/ln/channel.rs
lightning/src/ln/channelmanager.rs
lightning/src/util/ser_macros.rs

Simple merge
Simple merge
Simple merge
index c2ff9da67f38cc169c048ca7279952109f346d3d,0831649a34d67291ede605dd54faa8d6e4e01920..b5e5a43fee828515cd6c3f5570113615354758c3
@@@ -318,8 -312,21 +318,20 @@@ impl HTLCSource 
                        first_hop_htlc_msat: 0,
                        payment_id: PaymentId([2; 32]),
                        payment_secret: None,
 -                      payment_params: None,
                }
        }
+       #[cfg(debug_assertions)]
+       /// Checks whether this HTLCSource could possibly match the given HTLC output in a commitment
+       /// transaction. Useful to ensure different datastructures match up.
+       pub(crate) fn possibly_matches_output(&self, htlc: &super::chan_utils::HTLCOutputInCommitment) -> bool {
+               if let HTLCSource::OutboundRoute { first_hop_htlc_msat, .. } = self {
+                       *first_hop_htlc_msat == htlc.amount_msat
+               } else {
+                       // There's nothing we can check for forwarded HTLCs
+                       true
+               }
+       }
  }
  
  struct ReceiveError {
Simple merge