| 1747 | } |
| 1748 | |
| 1749 | static 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 | |
| 1774 | void ReconsiderBlock(ChainstateManager& chainman, uint256 block_hash) { |
| 1775 | { |
nothing calls this directly
no test coverage detected