From 801d2e865e017f1e794bef6904e1830cac9d50ac Mon Sep 17 00:00:00 2001 From: benthecarman Date: Wed, 3 Jan 2024 13:32:29 -0600 Subject: [PATCH] Properly return nerror for create_bip21 --- mutiny-core/src/lib.rs | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/mutiny-core/src/lib.rs b/mutiny-core/src/lib.rs index 6b55a1978..7e88ac855 100644 --- a/mutiny-core/src/lib.rs +++ b/mutiny-core/src/lib.rs @@ -830,10 +830,12 @@ impl MutinyWallet { let invoice = if self.safe_mode { None } else { - self.create_lightning_invoice(amount, labels.clone()) - .await - .ok() - .and_then(|invoice| invoice.bolt11) + Some( + self.create_lightning_invoice(amount, labels.clone()) + .await? + .bolt11 + .ok_or(MutinyError::InvoiceCreationFailed)?, + ) }; let Ok(address) = self.node_manager.get_new_address(labels.clone()) else {