Restore per-algo block index tracking
This commit is contained in:
parent
b913f39508
commit
2210ac3451
3 changed files with 40 additions and 5 deletions
|
|
@ -33,6 +33,18 @@ CBlockIndex::CBlockIndex(const CBlockHeader& block)
|
|||
|
||||
}
|
||||
|
||||
int CBlockIndex::GetAlgo() const
|
||||
{
|
||||
switch (nVersion & BLOCK_VERSION_ALGO) {
|
||||
case BLOCK_VERSION_SHA256D:
|
||||
return ALGO_SHA256D;
|
||||
case BLOCK_VERSION_RANDOMX:
|
||||
return ALGO_RANDOMX;
|
||||
default:
|
||||
return ALGO_UNKNOWN;
|
||||
}
|
||||
}
|
||||
|
||||
void CChain::SetTip(CBlockIndex *pindex) {
|
||||
if (pindex == nullptr) {
|
||||
vChain.clear();
|
||||
|
|
|
|||
Loading…
Reference in a new issue