Close Menu
  • Home
  • Altcoin
  • Bitcoin
  • Crypto
  • Forex
  • Online Money
What's Hot

Fox News to Air Charlie Kirk Tribute Special Saturday

September 14, 2025

Expanded Version of a Tweet I posted to X a Week ago last Wedneday.

September 14, 2025

bitcoin core – How does uncapping OP_RETURN impact long-term fee-market quality and security budget?

September 13, 2025
Facebook X (Twitter) Instagram
  • Altcoin
  • Bitcoin
  • Crypto
  • Forex
  • Online Money
Facebook X (Twitter) Instagram
Cointelegraphe
  • Home
  • Altcoin
  • Bitcoin
  • Crypto
  • Forex
  • Online Money
Cointelegraphe
Home»Bitcoin»altcoin development – Is there correct way to get the block height?
altcoin development – Is there correct way to get the block height?
Bitcoin

altcoin development – Is there correct way to get the block height?

adminBy adminJanuary 15, 2025No Comments2 Mins Read
Share
Facebook Twitter LinkedIn Pinterest Email


Questions about cryptocurrencies or projects that are not Bitcoin, and are not applicable to Bitcoin, are off-topic. For more information, see this meta discussion.


Questions about cryptocurrencies or projects that are not Bitcoin, and are not applicable to Bitcoin, are off-topic. For more information, see this meta discussion.

This is pow altcoin based, which use sha-256 alogo to mine all the coins. We had to change first 1M coins with randomX alog and rest with original algo. Added nHeight parameter to
checkproofofwork() in pow.cpp, Now, problem is the occurrences of checkproofofwork in called files, here, difficult in getting current block height, for example validation.cpp
static bool CheckBlockHeader(const CBlockHeader& block, BlockValidationState& state, const Consensus::Params& consensusParams, bool fCheckPOW = true) { // Check proof of work matches claimed amount // Check proof of work matches claimed amount extern ChainstateManager& chainman; // This not correct ? getting error int nHeight = GetBlockHeight(block, chainman); // here need chainman if (fCheckPOW && !CheckProofOfWork(block.GetHash(), block.nBits, consensusParams, nHeight)) return state.Invalid(BlockValidationResult::BLOCK_INVALID_HEADER, "high-hash", "proof of work 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("Parent block index not found for hash: " + block.hashPrevBlock.ToString()); } return pindex->nHeight + 1; } validation.cpp:4113:(.text+0x2cc1): undefined reference to `chainman’, What is the correct way tot get the block height?



Source link

Altcoin block correct Development height
Share. Facebook Twitter Pinterest LinkedIn Tumblr Email
admin
  • Website

Related Posts

bitcoin core – How does uncapping OP_RETURN impact long-term fee-market quality and security budget?

September 13, 2025

Ethereum Supply Shock? BitMine Absorbs 319,000 ETH In A Week

September 11, 2025

You Cannot Stop Bitcoin Metaprotocols

September 10, 2025

Ledger CTO Warns of NPM Supply-Chain Attack Hitting 1B+ Downloads

September 9, 2025
Add A Comment
Leave A Reply Cancel Reply

Top Insights

Fox News to Air Charlie Kirk Tribute Special Saturday

September 14, 2025

Expanded Version of a Tweet I posted to X a Week ago last Wedneday.

September 14, 2025

bitcoin core – How does uncapping OP_RETURN impact long-term fee-market quality and security budget?

September 13, 2025

Wall Street sets pace for Asia: Nikkei and KOSPI hit record highs – Forecasts – 12 September 2025

September 13, 2025
ads

Subscribe to Updates

Get the latest creative news from Cointelegraphe about Crypto, bItcoin and Altcoin.

About Us
About Us

At CoinTelegraphe, we are dedicated to bringing you the latest and most insightful news, analysis, and updates from the dynamic world of cryptocurrency. Our mission is to provide our readers with accurate, timely, and comprehensive information to help them navigate the complexities of the crypto market.

Facebook X (Twitter) Instagram Pinterest YouTube
Top Insights

Fox News to Air Charlie Kirk Tribute Special Saturday

September 14, 2025

Expanded Version of a Tweet I posted to X a Week ago last Wedneday.

September 14, 2025

bitcoin core – How does uncapping OP_RETURN impact long-term fee-market quality and security budget?

September 13, 2025
Get Informed

Subscribe to Updates

Get the latest creative news from Cointelegraphe about Crypto, bItcoin and Altcoin.

Please enable JavaScript in your browser to complete this form.
Loading
  • About us
  • Contact Us
  • Shop
  • Privacy Policy
  • Terms and Conditions
Copyright 2024 Cointelegraphe Design By Horaam Sultan.

Type above and press Enter to search. Press Esc to cancel.