}
}
+impl<D: tb::Bool, H: tb::Bool, T: tb::Bool, C: tb::Bool> InvoiceBuilder<D, H, T, C, tb::True> {
+ /// Sets the `basic_mpp` feature as optional.
+ pub fn basic_mpp(mut self) -> Self {
+ self.tagged_fields = self.tagged_fields
+ .drain(..)
+ .map(|field| match field {
+ TaggedField::Features(f) => TaggedField::Features(f.set_basic_mpp_optional()),
+ _ => field,
+ })
+ .collect();
+ self
+ }
+}
+
impl<S: tb::Bool> InvoiceBuilder<tb::True, tb::True, tb::True, tb::True, S> {
/// Builds and signs an invoice using the supplied `sign_function`. This function MAY NOT fail
/// and MUST produce a recoverable signature valid for the given hash and if applicable also for
.payee_pub_key(our_node_pubkey)
.payment_hash(Hash::from_slice(&payment_hash.0).unwrap())
.payment_secret(payment_secret)
+ .basic_mpp()
.min_final_cltv_expiry(MIN_FINAL_CLTV_EXPIRY.into());
if let Some(amt) = amt_msat {
invoice = invoice.amount_pico_btc(amt * 10);