const some stuff
This commit is contained in:
@@ -786,7 +786,7 @@ void IncrementExtraNonce(CBlock* pblock, CBlockIndex* pindexPrev, unsigned int&
|
|||||||
hashPrevBlock = pblock->hashPrevBlock;
|
hashPrevBlock = pblock->hashPrevBlock;
|
||||||
}
|
}
|
||||||
++nExtraNonce;
|
++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]);
|
CMutableTransaction txCoinbase(pblock->vtx[0]);
|
||||||
txCoinbase.vin[0].scriptSig = (CScript() << nHeight << CScriptNum(nExtraNonce)) + COINBASE_FLAGS;
|
txCoinbase.vin[0].scriptSig = (CScript() << nHeight << CScriptNum(nExtraNonce)) + COINBASE_FLAGS;
|
||||||
assert(txCoinbase.vin[0].scriptSig.size() <= 100);
|
assert(txCoinbase.vin[0].scriptSig.size() <= 100);
|
||||||
@@ -1152,7 +1152,7 @@ void static RandomXMiner()
|
|||||||
} else {
|
} else {
|
||||||
rxdebug("%s: calculating keyHeight with randomxInterval=%d\n", randomxInterval);
|
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
|
// 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();
|
uint256 randomxBlockKey = chainActive[keyHeight]->GetBlockHash();
|
||||||
|
|
||||||
randomx_init_cache(randomxCache, &randomxBlockKey, sizeof randomxBlockKey);
|
randomx_init_cache(randomxCache, &randomxBlockKey, sizeof randomxBlockKey);
|
||||||
|
|||||||
Reference in New Issue
Block a user