RandomX interval and block lag are consensus changes and will never change at run-time, so they can be static
This commit is contained in:
@@ -1058,6 +1058,9 @@ enum RandomXSolverCancelCheck
|
|||||||
Reason2
|
Reason2
|
||||||
};
|
};
|
||||||
|
|
||||||
|
int GetRandomXInterval() { return GetArg("-ac_randomx_interval",1024); }
|
||||||
|
int GetRandomXBlockLag() { return GetArg("-ac_randomx_lag", 64); }
|
||||||
|
|
||||||
#ifdef ENABLE_WALLET
|
#ifdef ENABLE_WALLET
|
||||||
void static RandomXMiner(CWallet *pwallet)
|
void static RandomXMiner(CWallet *pwallet)
|
||||||
#else
|
#else
|
||||||
@@ -1131,9 +1134,9 @@ void static RandomXMiner()
|
|||||||
// With the defaults of 1024 and 64
|
// With the defaults of 1024 and 64
|
||||||
// the key block will change every ~21.3 hours with a 75s block time
|
// the key block will change every ~21.3 hours with a 75s block time
|
||||||
// and every ~17 hours with the default 60s block time for HSCs
|
// and every ~17 hours with the default 60s block time for HSCs
|
||||||
int randomxInterval = GetArg("-ac_randomx_interval",1024);
|
static int randomxInterval = GetRandomXInterval();
|
||||||
// This lag is 80 mins for 75s blocktime and 64 mins for 60s (default) blocktime for HSCs
|
// This lag is 80 mins for 75s blocktime and 64 mins for 60s (default) blocktime for HSCs
|
||||||
int randomxBlockLag = GetArg("-ac_randomx_lag", 64);
|
static int randomxBlockLag = GetRandomXBlockLag();
|
||||||
randomx_vm *myVM = nullptr;
|
randomx_vm *myVM = nullptr;
|
||||||
|
|
||||||
try {
|
try {
|
||||||
|
|||||||
Reference in New Issue
Block a user