Create setter to modify blocktime consensus params at run-time

This commit is contained in:
Duke Leto
2020-07-11 11:10:15 -04:00
parent 55890a0543
commit d516a21d54
3 changed files with 14 additions and 7 deletions

View File

@@ -544,6 +544,14 @@ int32_t MAX_BLOCK_SIZE(int32_t height)
else return(2000000);
}
// Change the Hush blocktime at run-time(!)
void hush_changeblocktime()
{
pCurrentParams->consensus.nMaxFutureBlockTime = 7 * ASSETCHAINS_BLOCKTIME;
pCurrentParams->consensus.nPowTargetSpacing = ASSETCHAINS_BLOCKTIME;
fprintf(stderr,"HUSH blocktime changing to %d seconds\n",ASSETCHAINS_BLOCKTIME);
}
void komodo_setactivation(int32_t height)
{
pCurrentParams->consensus.vUpgrades[Consensus::UPGRADE_SAPLING].nActivationHeight = height;