That is pow altcoin based mostly, which use sha-256 alogo to mine all of the cash. We needed to change first 1M cash with randomX alog and relaxation with authentic algo. Added nHeight parameter to
checkproofofwork() in pow.cpp, Now, drawback is the occurrences of checkproofofwork in referred to as recordsdata, right here, troublesome in getting present block top, for instance validation.cppstatic bool CheckBlockHeader(const CBlockHeader& block, BlockValidationState& state, const Consensus::Params& consensusParams, bool fCheckPOW = true) { // Examine proof of labor matches claimed quantity // Examine proof of labor matches claimed quantity extern ChainstateManager& chainman; // This not appropriate ? getting error int nHeight = GetBlockHeight(block, chainman); // right here want chainman if (fCheckPOW && !CheckProofOfWork(block.GetHash(), block.nBits, consensusParams, nHeight)) return state.Invalid(BlockValidationResult::BLOCK_INVALID_HEADER, "high-hash", "proof of labor failed"); return true; } pow.cpp int GetBlockHeight(const CBlockHeader& block, ChainstateManager& chainman) { const CBlockIndex* pindex = chainman.ActiveChainstate().m_blockman.LookupBlockIndex(block.hashPrevBlock); if (!pindex) { throw std::runtime_error("Father or mother block index not discovered for hash: " + block.hashPrevBlock.ToString()); } return pindex->nHeight + 1; }
validation.cpp:4113:(.textual content+0x2cc1): undefined reference to `chainman’, What’s the appropriate manner tot get the block top?