diff --git a/mutiny-core/src/nostr/nwc.rs b/mutiny-core/src/nostr/nwc.rs index 92676d734..0c69349b9 100644 --- a/mutiny-core/src/nostr/nwc.rs +++ b/mutiny-core/src/nostr/nwc.rs @@ -999,6 +999,8 @@ impl NostrWalletConnect { nostr_manager.logger, "Payment timeout, not removing payment from budget" ); + + nostr_manager.save_nwc_profile(self.clone())?; } MutinyError::NonUniquePaymentHash => { log_warn!( @@ -1038,10 +1040,18 @@ impl NostrWalletConnect { } } + let code = match e { + MutinyError::InsufficientBalance => { + ErrorCode::InsufficientBalance + } + MutinyError::PaymentTimeout => return Ok(None), // don't send error message for timeout, it can still complete + _ => ErrorCode::PaymentFailed, + }; + Response { result_type: Method::PayInvoice, error: Some(NIP47Error { - code: ErrorCode::InsufficientBalance, + code, message: format!("Failed to pay invoice: {e}"), }), result: None,