From 3fba035c01a8bc370402559a2c43fdfd64fab0a1 Mon Sep 17 00:00:00 2001 From: Duke Date: Sat, 21 Sep 2024 11:04:25 -0400 Subject: [PATCH] const some stuff --- src/miner.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/miner.cpp b/src/miner.cpp index 7aedb7a34..96ea06236 100644 --- a/src/miner.cpp +++ b/src/miner.cpp @@ -786,7 +786,7 @@ void IncrementExtraNonce(CBlock* pblock, CBlockIndex* pindexPrev, unsigned int& hashPrevBlock = pblock->hashPrevBlock; } ++nExtraNonce; - unsigned int nHeight = pindexPrev->GetHeight()+1; // Height first in coinbase required for block.version=2 + const unsigned int nHeight = pindexPrev->GetHeight()+1; // Height first in coinbase required for block.version=2 CMutableTransaction txCoinbase(pblock->vtx[0]); txCoinbase.vin[0].scriptSig = (CScript() << nHeight << CScriptNum(nExtraNonce)) + COINBASE_FLAGS; assert(txCoinbase.vin[0].scriptSig.size() <= 100); @@ -1152,7 +1152,7 @@ void static RandomXMiner() } else { rxdebug("%s: calculating keyHeight with randomxInterval=%d\n", randomxInterval); // At heights between intervals, we use the same block key and wait randomxBlockLag blocks until changing - int keyHeight = ((Mining_height - randomxBlockLag) / randomxInterval) * randomxInterval; + const int keyHeight = ((Mining_height - randomxBlockLag) / randomxInterval) * randomxInterval; uint256 randomxBlockKey = chainActive[keyHeight]->GetBlockHash(); randomx_init_cache(randomxCache, &randomxBlockKey, sizeof randomxBlockKey);