Skip to content

Commit

Permalink
Set runtime begin scan height for cere testnet
Browse files Browse the repository at this point in the history
  • Loading branch information
wliyongfeng committed Feb 28, 2025
1 parent aacfda8 commit 7896152
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions backend/packages/runtime-scan/src/scan/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,23 @@ const {
} = require("@statescan/mongo");
const {
utils: { sleep },
env: { currentChain },
} = require("@osn/scan-common");

const cereTestnetMinHeight = 891032;

function fixScanStartHeight(height) {
if ("cere-testnet" === currentChain() && height < cereTestnetMinHeight) {
return cereTestnetMinHeight;
}

return height;
}

async function scan() {
const db = getRuntimeDb();
let toScanHeight = await db.getNextScanHeight();
toScanHeight = fixScanStartHeight(toScanHeight);
await deleteFrom(toScanHeight);

/*eslint no-constant-condition: ["error", { "checkLoops": false }]*/
Expand Down

0 comments on commit 7896152

Please sign in to comment.