diff --git a/account.py b/account.py index ed41e18..05d160a 100644 --- a/account.py +++ b/account.py @@ -1582,9 +1582,7 @@ def resendTXs(): } -def zapTXs(account): - age = 60 * 20 # 20 minutes - +def zapTXs(account, age=1200): account_name = check_account(account) if not account_name: diff --git a/main.py b/main.py index 8b74976..ebbefed 100644 --- a/main.py +++ b/main.py @@ -1200,7 +1200,15 @@ def settings_action(action): 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: return redirect("/settings?error=" + str(resp['error'])) return redirect("/settings?success=Zapped transactions")