Skip to content

Commit 890ce7d

Browse files
Un-cfg-gate StaticInvoices
We need to include static invoices in the public API as part of the onion messages we're adding for static invoice server support. Utilities to create these static invoices and other parts of the async receive API will remain cfg-gated for now. Generally, we can't totally avoid exposing half baked async receive support in the public API because OnionMessenger is parameterized by an async payments message handler, which can't be cfg-gated easily.
1 parent e62b5ec commit 890ce7d

File tree

4 files changed

+2
-3
lines changed

4 files changed

+2
-3
lines changed

lightning/src/offers/invoice_request.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -857,7 +857,7 @@ impl InvoiceRequest {
857857
);
858858
invoice_request_verify_method!(self, Self);
859859

860-
#[cfg(async_payments)]
860+
#[allow(unused)] // TODO: remove this once we remove the `async_payments` cfg flag
861861
pub(super) fn bytes(&self) -> &Vec<u8> {
862862
&self.bytes
863863
}

lightning/src/offers/mod.rs

-1
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@ pub mod parse;
2525
mod payer;
2626
pub mod refund;
2727
pub(crate) mod signer;
28-
#[cfg(async_payments)]
2928
pub mod static_invoice;
3029
#[cfg(test)]
3130
pub(crate) mod test_utils;

lightning/src/offers/offer.rs

-1
Original file line numberDiff line numberDiff line change
@@ -742,7 +742,6 @@ impl Offer {
742742
.chain(TlvStream::new(bytes).range(EXPERIMENTAL_OFFER_TYPES))
743743
}
744744

745-
#[cfg(async_payments)]
746745
pub(super) fn verify<T: secp256k1::Signing>(
747746
&self, nonce: Nonce, key: &ExpandedKey, secp_ctx: &Secp256k1<T>,
748747
) -> Result<(OfferId, Option<Keypair>), ()> {

lightning/src/offers/static_invoice.rs

+1
Original file line numberDiff line numberDiff line change
@@ -379,6 +379,7 @@ impl StaticInvoice {
379379
self.signature
380380
}
381381

382+
#[allow(unused)] // TODO: remove this once we remove the `async_payments` cfg flag
382383
pub(crate) fn from_same_offer(&self, invreq: &InvoiceRequest) -> bool {
383384
let invoice_offer_tlv_stream =
384385
Offer::tlv_stream_iter(&self.bytes).map(|tlv_record| tlv_record.record_bytes);

0 commit comments

Comments
 (0)