Skip to content

Commit e7fe1a4

Browse files
committed
f - check amount_msats after authentication
1 parent bb04aef commit e7fe1a4

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed

lightning/src/ln/channelmanager.rs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -10527,13 +10527,6 @@ where
1052710527
_ => return ResponseInstruction::NoResponse,
1052810528
};
1052910529

10530-
let amount_msats = match InvoiceBuilder::<DerivedSigningPubkey>::amount_msats(
10531-
&invoice_request
10532-
) {
10533-
Ok(amount_msats) => amount_msats,
10534-
Err(error) => return responder.respond(OffersMessage::InvoiceError(error.into())),
10535-
};
10536-
1053710530
let invoice_request = match nonce {
1053810531
Some(nonce) => match invoice_request.verify_using_recipient_data(
1053910532
nonce, expanded_key, secp_ctx,
@@ -10550,6 +10543,13 @@ where
1055010543
},
1055110544
};
1055210545

10546+
let amount_msats = match InvoiceBuilder::<DerivedSigningPubkey>::amount_msats(
10547+
&invoice_request.inner
10548+
) {
10549+
Ok(amount_msats) => amount_msats,
10550+
Err(error) => return responder.respond(OffersMessage::InvoiceError(error.into())),
10551+
};
10552+
1055310553
let relative_expiry = DEFAULT_RELATIVE_EXPIRY.as_secs() as u32;
1055410554
let (payment_hash, payment_secret) = match self.create_inbound_payment(
1055510555
Some(amount_msats), relative_expiry, None

lightning/src/offers/invoice_request.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -613,7 +613,7 @@ pub struct VerifiedInvoiceRequest {
613613
pub offer_id: OfferId,
614614

615615
/// The verified request.
616-
inner: InvoiceRequest,
616+
pub(crate) inner: InvoiceRequest,
617617

618618
/// Keys used for signing a [`Bolt12Invoice`] if they can be derived.
619619
///

0 commit comments

Comments
 (0)