Skip to content

Commit

Permalink
Save budget exceed nwcs to approval list
Browse files Browse the repository at this point in the history
  • Loading branch information
benthecarman committed Sep 23, 2023
1 parent bfba99a commit bb5269f
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion mutiny-core/src/nostr/nwc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -300,7 +300,6 @@ impl NostrWalletConnect {
event_pk: XOnlyPublicKey,
invoice: Bolt11Invoice,
) -> anyhow::Result<()> {
// for non-timeout errors, add to manual approval list
let pending = PendingNwcInvoice {
index: self.profile.index,
invoice,
Expand Down Expand Up @@ -440,6 +439,7 @@ impl NostrWalletConnect {
);
code = ErrorCode::Internal;
} else {
// for non-timeout errors, add to manual approval list
self.save_pending_nwc_invoice(
nostr_manager,
event.id,
Expand Down Expand Up @@ -557,6 +557,14 @@ impl NostrWalletConnect {
let content = match budget_err {
Some(err) => {
log_warn!(nostr_manager.logger, "Attempted to exceed budget: {err}");
// add to manual approval list
self.save_pending_nwc_invoice(
nostr_manager,
event.id,
event.pubkey,
invoice,
)
.await?;
Response {
result_type: Method::PayInvoice,
error: Some(NIP47Error {
Expand Down

0 comments on commit bb5269f

Please sign in to comment.