1

I have been learning the ins and outs of the bitcoin source code over the past 3 months but I can say I have not fully mastered it yet. I wish to understand how the genesis block is validated using the CheckProofOfWork() function. I would like to do something like this in chainsparams.cpp:

while (!CheckProofOfWork(block.GetHash(), block.nBits, chainparams.GetConsensus())) ++block.nNonce;

Where I seem to be stuck is how to obtain chainparams.GetConsensus() inside of chainsparams.cpp

Any guidance would be appreciated.

Thanks In Advance

2
  • I am also stuck at this stage... searched a lot, but none... Have you found anything?
    – creator
    Feb 23, 2018 at 7:06
  • And what is variable 'block'? Isn't it 'genesis' variable in newest source?
    – creator
    Feb 23, 2018 at 7:11

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Browse other questions tagged or ask your own question.