Skip to content

Commit cf8d07c

Browse files
f use new spontaneous_pmt_key instead offers_base_key
1 parent ad317a9 commit cf8d07c

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

lightning/src/ln/inbound_payment.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -204,7 +204,7 @@ pub(super) fn create_for_spontaneous_payment(
204204
min_final_cltv_expiry_delta
205205
)?;
206206

207-
let mut hmac = HmacEngine::<Sha256>::new(&keys.offers_base_key);
207+
let mut hmac = HmacEngine::<Sha256>::new(&keys.spontaneous_pmt_key);
208208
hmac.input(&metadata_bytes);
209209
let hmac_bytes = Hmac::from_engine(hmac).to_byte_array();
210210

@@ -344,7 +344,7 @@ pub(super) fn verify<L: Deref>(payment_hash: PaymentHash, payment_data: &msgs::F
344344
}
345345
},
346346
Ok(Method::SpontaneousPayment) => {
347-
let mut hmac = HmacEngine::<Sha256>::new(&keys.offers_base_key);
347+
let mut hmac = HmacEngine::<Sha256>::new(&keys.spontaneous_pmt_key);
348348
hmac.input(&metadata_bytes[..]);
349349
if !fixed_time_eq(&iv_bytes, &Hmac::from_engine(hmac).to_byte_array().split_at_mut(IV_LEN).0) {
350350
log_trace!(logger, "Failing async payment HTLC with sender-generated payment_hash {}: unexpected payment_secret", &payment_hash);

0 commit comments

Comments
 (0)