From 3df50d4890b30cf969088987757d1179df7177eb Mon Sep 17 00:00:00 2001 From: benthecarman Date: Fri, 15 Sep 2023 20:45:04 -0500 Subject: [PATCH] Use saturating_sub in budget_remaining --- mutiny-core/src/nostr/nwc.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mutiny-core/src/nostr/nwc.rs b/mutiny-core/src/nostr/nwc.rs index e7b80c098..02e122bc9 100644 --- a/mutiny-core/src/nostr/nwc.rs +++ b/mutiny-core/src/nostr/nwc.rs @@ -119,7 +119,7 @@ impl BudgetedSpendingConditions { pub fn budget_remaining(&self) -> u64 { let mut clone = self.clone(); - self.budget - clone.sum_payments() + self.budget.saturating_sub(clone.sum_payments()) } }