mirror of
https://github.com/bitcoin/bitcoin.git
synced 2026-02-01 19:21:10 +00:00
bf7996cbc3becf329d8b1cd2f1007fec9b3a3188 rpc: fix getblock(header) returns target for tip (Sjors Provoost) 4c3c1f42cf705e039751395799240da33ca969bd test: 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: utACK bf7996cbc3becf329d8b1cd2f1007fec9b3a3188 luke-jr: crACK bf7996cbc3becf329d8b1cd2f1007fec9b3a3188 TheCharlatan: ACK bf7996cbc3becf329d8b1cd2f1007fec9b3a3188 ismaelsadeeq: Code review ACK bf7996cbc3becf329d8b1cd2f1007fec9b3a3188 Tree-SHA512: 2a2e11efd91f4aaccf9d2ec4dff9fd82c366b8a7e797ce5981dca2e6f08028f69154f4e6a27aef20d78b0e6c3304416789267c2fad42d7aa5072f8537d0c8b0d