Merge pull request #2139 from TheBlueMatt/2023-03-metadata-prefactors
authorMatt Corallo <649246+TheBlueMatt@users.noreply.github.com>
Fri, 7 Apr 2023 16:14:30 +0000 (16:14 +0000)
committerGitHub <noreply@github.com>
Fri, 7 Apr 2023 16:14:30 +0000 (16:14 +0000)
Add a new `RecipientOnionFields` and replace `PaymentSecret` with it

1  2 
lightning/src/chain/channelmonitor.rs
lightning/src/ln/channel.rs
lightning/src/ln/channelmanager.rs
lightning/src/ln/functional_tests.rs

Simple merge
Simple merge
index 59f92b2023a273492bbc16a3a88537a342c7cf02,7c84df75eb1c6e66b8d94a8f47befde4f6f414e4..4bc60dcffda25487447e1e34d0fc6a4718ebade1
@@@ -317,21 -315,8 +315,20 @@@ impl HTLCSource 
                        session_priv: SecretKey::from_slice(&[1; 32]).unwrap(),
                        first_hop_htlc_msat: 0,
                        payment_id: PaymentId([2; 32]),
-                       payment_secret: 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