From 34f19a7fe767364c759b9e26ec78e6add8de3276 Mon Sep 17 00:00:00 2001 From: benthecarman Date: Thu, 19 Dec 2024 11:15:55 -0600 Subject: [PATCH] lower amt --- src/main.rs | 2 +- src/nostr_dms.rs | 2 +- src/payments.rs | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/main.rs b/src/main.rs index aa6eac2..84d76bf 100644 --- a/src/main.rs +++ b/src/main.rs @@ -355,7 +355,7 @@ async fn lnurlw_callback_handler( .and_then(|x| HeaderValue::to_str(x).ok()) .unwrap_or("Unknown"); - if state.payments.get_total_payments(x_forwarded_for).await > MAX_SEND_AMOUNT * 10 { + if state.payments.get_total_payments(x_forwarded_for).await > MAX_SEND_AMOUNT { return Err(Json(json!({"status": "ERROR", "reason": "Incorrect k1"}))); } diff --git a/src/nostr_dms.rs b/src/nostr_dms.rs index 6c6e081..58edfa6 100644 --- a/src/nostr_dms.rs +++ b/src/nostr_dms.rs @@ -177,7 +177,7 @@ async fn handle_event(event: Event, state: AppState) -> anyhow::Result<()> { .payments .get_total_payments(&event.pubkey.to_string()) .await - > MAX_SEND_AMOUNT * 10 + > MAX_SEND_AMOUNT { return Err(anyhow::anyhow!("Too many payments")); } diff --git a/src/payments.rs b/src/payments.rs index db78fb8..2040a11 100644 --- a/src/payments.rs +++ b/src/payments.rs @@ -119,6 +119,6 @@ impl PaymentsByIp { total += tracker.sum_payments(); } } - total >= MAX_SEND_AMOUNT * 10 || addr_amt >= MAX_SEND_AMOUNT + total >= MAX_SEND_AMOUNT || addr_amt >= MAX_SEND_AMOUNT } }