4

I'm running a bitcoind instance in regtest mode, for automated testing purposes.

I'm having trouble with the fact that the blocks I mine are version 1 blocks, which lack the block height in the coinbase transaction (my code relied on that).

How do block versions work in regtest mode? Can I configure them? Do I need to mine a specific number of blocks?

3

BIP 34 (the BIP that specifies block version 2 and block heights in coinbases) is not activated on regtest and is never activated.

How do block versions work in regtest mode?

Block versions are actually version 0x20000000, not version 1. This version allows for other soft forks like BIPs 65 and 66 be activated. Some other forks (BIP16, CSV, and Segwit) are activated by default, and BIP 34 is disabled.

Can I configure them?

Yes, use the -blockversion command line option when starting bitcoind

Do I need to mine a specific number of blocks?

For BIP 34, no, you can't activate it without changing the software.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.