Define avg block time to 10 min until we have at least 146 block in the current epoch

This commit is contained in:
nymkappa 2022-05-17 14:40:18 +02:00
parent da3f516388
commit 47bb073b9a
No known key found for this signature in database
GPG Key ID: E155910B16E8BD04

View File

@ -32,7 +32,7 @@ class DifficultyAdjustmentApi {
} }
} }
let timeAvgMins = blocksInEpoch ? diff / blocksInEpoch / 60 : 10; let timeAvgMins = blocksInEpoch && blocksInEpoch > 146 ? diff / blocksInEpoch / 60 : 10;
// Testnet difficulty is set to 1 after 20 minutes of no blocks, // Testnet difficulty is set to 1 after 20 minutes of no blocks,
// therefore the time between blocks will always be below 20 minutes (1200s). // therefore the time between blocks will always be below 20 minutes (1200s).