Altering blockinfo to include valid nonce and extraNonce's in the miner_tests

1

I currently work on upgrading an old cryptocurrency (fork of an old bitcoin version) to the latest of Bitcoin that includes a lot of tests.

I currently am stuck with making this test succeed: https://github.com/bitcoin/bitcoin/blob/2971fd030f6e20ff5279bd86ba18acc5e5ed1ce9/src/test/miner_tests.cpp#L249

I believe this issue is because of the hardcoded data in blockinfo (see: https://github.com/bitcoin/bitcoin/blob/2971fd030f6e20ff5279bd86ba18acc5e5ed1ce9/src/test/miner_tests.cpp#L54)

How do I get blockinfo to update with the right nonce and extraNonce?

I tried different things, including trying to increase the pblock->nNonce by 1 until I hit the right PoW target, but for some reason pblock->GetPoWHash() didn't change after that.

Thanks!

Peter Willemsen

Posted 2017-12-24T03:28:15.627

Reputation: 101

No answers