reset reserve retry timeout when forcing operation

This commit is contained in:
Florian Dold 2020-01-22 16:00:49 +01:00
parent 14103aa075
commit a60061788f
No known key found for this signature in database
GPG Key ID: D2E4F00F29D02A4B

View File

@ -61,6 +61,19 @@ import { getTimestampNow } from "../util/time";
const logger = new Logger("reserves.ts"); 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. * 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"); logger.trace("processReserve retry not due yet");
return; return;
} }
} else {
await resetReserveRetry(ws, reservePub);
} }
logger.trace( logger.trace(
`Processing reserve ${reservePub} with status ${reserve.reserveStatus}`, `Processing reserve ${reservePub} with status ${reserve.reserveStatus}`,