Skip to content

Commit edcc063

Browse files
committed
f - impl Default for Bolt11InvoiceParameters
1 parent 7e3ba70 commit edcc063

File tree

1 file changed

+15
-1
lines changed

1 file changed

+15
-1
lines changed

lightning/src/ln/channelmanager.rs

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ use {
102102
crate::offers::refund::RefundMaybeWithDerivedMetadataBuilder,
103103
};
104104

105-
use lightning_invoice::{Bolt11Invoice, Bolt11InvoiceDescription, CreationError, Currency, InvoiceBuilder as Bolt11InvoiceBuilder, SignOrCreationError, DEFAULT_EXPIRY_TIME};
105+
use lightning_invoice::{Bolt11Invoice, Bolt11InvoiceDescription, CreationError, Currency, Description, InvoiceBuilder as Bolt11InvoiceBuilder, SignOrCreationError, DEFAULT_EXPIRY_TIME};
106106

107107
use alloc::collections::{btree_map, BTreeMap};
108108

@@ -9235,6 +9235,20 @@ pub struct Bolt11InvoiceParameters {
92359235
pub payment_hash: Option<PaymentHash>,
92369236
}
92379237

9238+
impl Default for Bolt11InvoiceParameters {
9239+
fn default() -> Self {
9240+
Self {
9241+
currency: None,
9242+
amount_msats: None,
9243+
description: Bolt11InvoiceDescription::Direct(Description::empty()),
9244+
duration_since_epoch: None,
9245+
invoice_expiry_delta_secs: None,
9246+
min_final_cltv_expiry_delta: None,
9247+
payment_hash: None,
9248+
}
9249+
}
9250+
}
9251+
92389252
macro_rules! create_offer_builder { ($self: ident, $builder: ty) => {
92399253
/// Creates an [`OfferBuilder`] such that the [`Offer`] it builds is recognized by the
92409254
/// [`ChannelManager`] when handling [`InvoiceRequest`] messages for the offer. The offer's

0 commit comments

Comments
 (0)