Restore per-algo block index tracking

This commit is contained in:
Capri 2026-09-12 20:32:57 +00:00
commit 2210ac3451
Signed by: VextaProject
SSH key fingerprint: SHA256:739BZv8LvIDY2tR7lXLy/IQ6MaGTQtYcG9GNvCjmpVM
3 changed files with 40 additions and 5 deletions

View file

@ -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();