Don't assume two difficulty with the same value is impossible

This commit is contained in:
nymkappa
2022-02-22 22:53:47 +09:00
parent 74005bb0b1
commit 22874f6c91
3 changed files with 44 additions and 9 deletions

View File

@@ -161,7 +161,18 @@ class Mining {
++totalIndexed;
}
await HashratesRepository.$saveHashrates(hashrates);
// Add genesis block manually
if (!indexedTimestamp.includes(genesisTimestamp)) {
hashrates.push({
hashrateTimestamp: genesisTimestamp,
avgHashrate: await bitcoinClient.getNetworkHashPs(1, 1),
poolId: null
});
}
if (hashrates.length > 0) {
await HashratesRepository.$saveHashrates(hashrates);
}
await HashratesRepository.$setLatestRunTimestamp();
this.hashrateIndexingStarted = false;