mirror of
https://github.com/bitcoin/bitcoin.git
synced 2026-01-20 07:09:15 +01:00
bf7996cbc3rpc: fix getblock(header) returns target for tip (Sjors Provoost)4c3c1f42cftest: add block 2016 to mock mainnet (Sjors Provoost) Pull request description: A `target` field was added to the `getblock` and `getblockheader` RPC calls in #31583, but it mistakingly always used the tip value. This PR fixes it to return the target for the given block. Because regtest does not have difficulty adjustment, the mainnet test is expanded to cover the fix. A preliminary commit deals with mining block 2016 that's needed for the test. It also: - renames the `create_coinbase` `retarget_period` argument to `halving_period`. Before #31583 this was hardcoded for regtest where these values are the same. - drops unused `fees` argument from `mine` helper - expands the CPU miner instructions for generating the alternative mainnet chain Fixes #33440 ACKs for top commit: sipa: utACKbf7996cbc3luke-jr: crACKbf7996cbc3TheCharlatan: ACKbf7996cbc3ismaelsadeeq: Code review ACKbf7996cbc3Tree-SHA512: 2a2e11efd91f4aaccf9d2ec4dff9fd82c366b8a7e797ce5981dca2e6f08028f69154f4e6a27aef20d78b0e6c3304416789267c2fad42d7aa5072f8537d0c8b0d