MCPcopy Create free account
hub / github.com/BTCGPU/BTCGPU / reconsiderblock

Function reconsiderblock

src/rpc/blockchain.cpp:1609–1645  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1607}
1608
1609static UniValue reconsiderblock(const JSONRPCRequest& request)
1610{
1611 if (request.fHelp || request.params.size() != 1)
1612 throw std::runtime_error(
1613 "reconsiderblock \"blockhash\"\n"
1614 "\nRemoves invalidity status of a block and its descendants, reconsider them for activation.\n"
1615 "This can be used to undo the effects of invalidateblock.\n"
1616 "\nArguments:\n"
1617 "1. \"blockhash\" (string, required) the hash of the block to reconsider\n"
1618 "\nResult:\n"
1619 "\nExamples:\n"
1620 + HelpExampleCli("reconsiderblock", "\"blockhash\"")
1621 + HelpExampleRpc("reconsiderblock", "\"blockhash\"")
1622 );
1623
1624 std::string strHash = request.params[0].get_str();
1625 uint256 hash(uint256S(strHash));
1626
1627 {
1628 LOCK(cs_main);
1629 CBlockIndex* pblockindex = LookupBlockIndex(hash);
1630 if (!pblockindex) {
1631 throw JSONRPCError(RPC_INVALID_ADDRESS_OR_KEY, "Block not found");
1632 }
1633
1634 ResetBlockFailureFlags(pblockindex);
1635 }
1636
1637 CValidationState state;
1638 ActivateBestChain(state, Params());
1639
1640 if (!state.IsValid()) {
1641 throw JSONRPCError(RPC_DATABASE_ERROR, FormatStateMessage(state));
1642 }
1643
1644 return NullUniValue;
1645}
1646
1647static UniValue getchaintxstats(const JSONRPCRequest& request)
1648{

Callers

nothing calls this directly

Calls 11

HelpExampleCliFunction · 0.85
HelpExampleRpcFunction · 0.85
uint256SFunction · 0.85
LookupBlockIndexFunction · 0.85
JSONRPCErrorFunction · 0.85
ResetBlockFailureFlagsFunction · 0.85
ActivateBestChainFunction · 0.85
FormatStateMessageFunction · 0.85
ParamsClass · 0.50
sizeMethod · 0.45
IsValidMethod · 0.45

Tested by

no test coverage detected