A caller can check if a block template is valid and is good to spend work on
rpc: Add testblocktemplatevalidity #13415
pull MarcoFalke wants to merge 1 commits into bitcoin:master from MarcoFalke:Mf1806-rpcTestblocktemplatevalidity changing 2 files +50 −3-
MarcoFalke commented at 6:55 PM on June 7, 2018: member
-
MarcoFalke commented at 6:56 PM on June 7, 2018: member
TODO: Add tests (Currently left out to avoid excessive merge conflicts with other pull requests touching the miner tests)
- MarcoFalke added the label RPC/REST/ZMQ on Jun 7, 2018
- MarcoFalke added the label Mining on Jun 7, 2018
-
DrahtBot commented at 7:31 PM on June 7, 2018: member
<!--e57a25ab6845829454e8d69fc972939a-->Note to reviewers: This pull request conflicts with the following ones:
- #13945 (Refactoring CRPCCommand with enum category by isghe)
- #13864 (validation: Document where we are intentionally ignoring bool return values from validation related functions by practicalswift)
- #13083 (Add compile time checking for cs_main runtime locking assertions by practicalswift)
If you consider this pull request important, please also help to review the conflicting pull requests. Ideally, start with the one that should be merged first.
-
in src/rpc/mining.cpp:300 in fa040362cb outdated
295 | + UniValue result(UniValue::VOBJ); 296 | + result.pushKV("block_hash", block.GetHash().GetHex()); 297 | + CValidationState state; 298 | + bool valid_template = TestBlockValidity(state, Params(), block, /* pindexPrev */ tip, /* fCheckPOW */ false, /* fCheckMerkleRoot */ true); 299 | + result.pushKV("valid_template", valid_template); 300 | + if (valid_template) {
Empact commented at 9:14 PM on June 7, 2018:Is this inverted?
luke-jr commented at 9:18 PM on June 7, 2018: memberThis is already supported via BIP 23 Block Proposals: https://github.com/bitcoin/bips/blob/master/bip-0023.mediawiki#Block_Proposal
promag commented at 11:29 AM on June 10, 2018: memberRight, looks like this is already implemented https://github.com/bitcoin/bitcoin/blob/56f69360dc98bd68704f19646a84d045788d199e/src/rpc/mining.cpp#L389-L416
MarcoFalke force-pushed on Jun 15, 2018MarcoFalke force-pushed on Jul 11, 2018laanwj added this to the milestone 0.18.0 on Aug 2, 2018laanwj added the label Feature on Aug 2, 2018rpc: Add testblocktemplatevalidity 28057de21aMarcoFalke force-pushed on Aug 15, 2018MarcoFalke closed this on Aug 15, 2018MarcoFalke deleted the branch on Aug 15, 2018DrahtBot locked this on Sep 8, 2021
github-metadata-mirror
This is a metadata mirror of the GitHub repository bitcoin/bitcoin. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2026-04-13 15:15 UTC
This is a metadata mirror of the GitHub repository bitcoin/bitcoin. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2026-04-13 15:15 UTC
This site is hosted by @0xB10C
More mirrored repositories can be found on mirror.b10c.me
More mirrored repositories can be found on mirror.b10c.me