Merge pull request #1422 from mempool/nymkappa/bugfix/halving-calculation

Use 10 minutes avg block time for halving calculation
This commit is contained in:
wiz 2022-03-21 03:32:45 +00:00 committed by GitHub
commit 4c14278da6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -63,10 +63,8 @@ export class DifficultyComponent implements OnInit {
colorPreviousAdjustments = '#ffffff66';
}
const timeAvgMins = da.timeAvg;
const now = new Date().getTime() / 1000;
const blocksUntilHalving = 210000 - (block.height % 210000);
const timeUntilHalving = (blocksUntilHalving * timeAvgMins * 60 * 1000) + (now * 1000);
const timeUntilHalving = new Date().getTime() + (blocksUntilHalving * 600000);
const data = {
base: `${da.progressPercent.toFixed(2)}%`,