Throw error where most recent fetched signature has slot less than afterSlot

This commit is contained in:
Nicholas Clarke 2022-01-12 23:41:52 -08:00
parent 7fdb6d1a9a
commit 44b3b7027a
2 changed files with 7 additions and 2 deletions

View File

@ -228,8 +228,8 @@ async function main() {
} catch (e: any) {
notify('v3: ' + e.toString());
console.log(e, e.stack);
// Wait for 10 mins
await sleep(10 * 60 * 1000);
// Wait for 60 seconds
await sleep(60 * 1000);
}
}
}

View File

@ -32,6 +32,11 @@ export async function getNewSignatures(
signatures = signaturesInfo.map((x) => x['signature']);
slots = signaturesInfo.map((x) => x['slot']);
if (signaturesInfo[0].slot < afterSlot) {
// Possibly this happens when validators are switched at the endpoint?
throw 'most recent fetched signature has slot less than afterSlot'
}
console.log('slots ' + signaturesInfo[0].slot + ' to ' + signaturesInfo[signaturesInfo.length - 1].slot)
console.log(
new Date(