MCPcopy Create free account
hub / github.com/bitcoin/bitcoin / invalidateblock

Function invalidateblock

src/rpc/blockchain.cpp:1749–1772  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1747}
1748
1749static RPCMethod invalidateblock()
1750{
1751 return RPCMethod{
1752 "invalidateblock",
1753 "Permanently marks a block as invalid, as if it violated a consensus rule.\n",
1754 {
1755 {"blockhash", RPCArg::Type::STR_HEX, RPCArg::Optional::NO, "the hash of the block to mark as invalid"},
1756 },
1757 RPCResult{RPCResult::Type::NONE, "", ""},
1758 RPCExamples{
1759 HelpExampleCli("invalidateblock", "\"blockhash\"")
1760 + HelpExampleRpc("invalidateblock", "\"blockhash\"")
1761 },
1762 [](const RPCMethod& self, const JSONRPCRequest& request) -> UniValue
1763{
1764 ChainstateManager& chainman = EnsureAnyChainman(request.context);
1765 uint256 hash(ParseHashV(request.params[0], "blockhash"));
1766
1767 InvalidateBlock(chainman, hash);
1768
1769 return UniValue::VNULL;
1770},
1771 };
1772}
1773
1774void ReconsiderBlock(ChainstateManager& chainman, uint256 block_hash) {
1775 {

Callers

nothing calls this directly

Calls 4

HelpExampleCliFunction · 0.85
HelpExampleRpcFunction · 0.85
ParseHashVFunction · 0.85
InvalidateBlockFunction · 0.85

Tested by

no test coverage detected