X-Git-Url: http://git.bitcoin.ninja/index.cgi?a=blobdiff_plain;f=lightning-invoice%2Fsrc%2Flib.rs;fp=lightning-invoice%2Fsrc%2Flib.rs;h=9ee8e49b7dcb8d2a2b307f12087b815659764dc0;hb=20e776bc8e2ebe7af3df99227c1f1a5467f42fc3;hp=11406a4644dd0f0e0c5133dc89cf8c84c55f7bbb;hpb=b5f0ebab77961ce243fcf5a5fad3d4e161f4952a;p=rust-lightning diff --git a/lightning-invoice/src/lib.rs b/lightning-invoice/src/lib.rs index 11406a464..9ee8e49b7 100644 --- a/lightning-invoice/src/lib.rs +++ b/lightning-invoice/src/lib.rs @@ -607,6 +607,20 @@ impl InvoiceBuilder InvoiceBuilder { + /// 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 InvoiceBuilder { /// 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