feat: Allow zapping txs of a different age
All checks were successful
Tests and Linting / Tests-Linting (3.11) (push) Successful in 31s
Tests and Linting / Tests-Linting (3.10) (push) Successful in 34s
Tests and Linting / Tests-Linting (3.13) (push) Successful in 35s
Build Docker / Build Images (map[dockerfile:Dockerfile.hsd tag_suffix:-hsd target:hsd]) (push) Successful in 42s
Build Docker / Build Images (map[dockerfile:Dockerfile tag_suffix: target:default]) (push) Successful in 45s

This commit is contained in:
2025-09-02 17:58:40 +10:00
parent 6d318a597b
commit 812fc84d3e
2 changed files with 10 additions and 4 deletions

View File

@@ -1582,9 +1582,7 @@ def resendTXs():
} }
def zapTXs(account): def zapTXs(account, age=1200):
age = 60 * 20 # 20 minutes
account_name = check_account(account) account_name = check_account(account)
if not account_name: if not account_name:

10
main.py
View File

@@ -1200,7 +1200,15 @@ def settings_action(action):
if action == "zap": if action == "zap":
resp = account_module.zapTXs(request.cookies.get("account")) age = request.args.get("age", 1200)
try:
age = int(age)
except ValueError:
age = 1200
if age < 0:
age = 1200
resp = account_module.zapTXs(request.cookies.get("account"),age)
if type(resp) is dict and 'error' in resp: if type(resp) is dict and 'error' in resp:
return redirect("/settings?error=" + str(resp['error'])) return redirect("/settings?error=" + str(resp['error']))
return redirect("/settings?success=Zapped transactions") return redirect("/settings?success=Zapped transactions")