diff options
author | Florian Dold <florian.dold@gmail.com> | 2020-01-22 16:00:49 +0100 |
---|---|---|
committer | Florian Dold <florian.dold@gmail.com> | 2020-01-22 16:00:49 +0100 |
commit | a60061788fc9fd0cc60472db5e3ef68d34854441 (patch) | |
tree | 29016a5e2872b07340dfa859f1b53f6cb8596e66 /src | |
parent | 14103aa0750fd2874480a564b2f0be0932c13e21 (diff) |
reset reserve retry timeout when forcing operation
Diffstat (limited to 'src')
-rw-r--r-- | src/operations/reserves.ts | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/src/operations/reserves.ts b/src/operations/reserves.ts index 7f5c7d05f..463b57b6c 100644 --- a/src/operations/reserves.ts +++ b/src/operations/reserves.ts @@ -61,6 +61,19 @@ import { getTimestampNow } from "../util/time"; const logger = new Logger("reserves.ts"); + +async function resetReserveRetry( + ws: InternalWalletState, + reservePub: string, +) { + await ws.db.mutate(Stores.reserves, reservePub, x => { + if (x.retryInfo.active) { + x.retryInfo = initRetryInfo(); + } + return x; + }); +} + /** * Create a reserve, but do not flag it as confirmed yet. * @@ -504,6 +517,8 @@ async function processReserveImpl( logger.trace("processReserve retry not due yet"); return; } + } else { + await resetReserveRetry(ws, reservePub); } logger.trace( `Processing reserve ${reservePub} with status ${reserve.reserveStatus}`, |