Skip to content

Commit

Permalink
Merge pull request #932 from MutinyWallet/fix-bip21
Browse files Browse the repository at this point in the history
Properly return error for create_bip21
  • Loading branch information
TonyGiorgio authored Jan 4, 2024
2 parents 919a491 + 801d2e8 commit 4b2f830
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions mutiny-core/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -893,10 +893,12 @@ impl<S: MutinyStorage> MutinyWallet<S> {
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 {
Expand Down

0 comments on commit 4b2f830

Please sign in to comment.