Changeset View
Changeset View
Standalone View
Standalone View
src/rpc/blockchain.cpp
Show First 20 Lines • Show All 426 Lines • ▼ Show 20 Lines | |||||
static UniValue | static UniValue | ||||
syncwithvalidationinterfacequeue(const Config &config, | syncwithvalidationinterfacequeue(const Config &config, | ||||
const JSONRPCRequest &request) { | const JSONRPCRequest &request) { | ||||
RPCHelpMan{ | RPCHelpMan{ | ||||
"syncwithvalidationinterfacequeue", | "syncwithvalidationinterfacequeue", | ||||
"Waits for the validation interface queue to catch up on everything " | "Waits for the validation interface queue to catch up on everything " | ||||
"that was there when we entered this function.\n", | "that was there when we entered this function.\n", | ||||
{}, | {}, | ||||
RPCResults{}, | RPCResult{RPCResult::Type::NONE, "", ""}, | ||||
RPCExamples{HelpExampleCli("syncwithvalidationinterfacequeue", "") + | RPCExamples{HelpExampleCli("syncwithvalidationinterfacequeue", "") + | ||||
HelpExampleRpc("syncwithvalidationinterfacequeue", "")}, | HelpExampleRpc("syncwithvalidationinterfacequeue", "")}, | ||||
} | } | ||||
.Check(request); | .Check(request); | ||||
SyncWithValidationInterfaceQueue(); | SyncWithValidationInterfaceQueue(); | ||||
return NullUniValue; | return NullUniValue; | ||||
} | } | ||||
▲ Show 20 Lines • Show All 1,329 Lines • ▼ Show 20 Lines | RPCHelpMan{ | ||||
"work.\n" | "work.\n" | ||||
"\nA later preciousblock call can override the effect of an earlier " | "\nA later preciousblock call can override the effect of an earlier " | ||||
"one.\n" | "one.\n" | ||||
"\nThe effects of preciousblock are not retained across restarts.\n", | "\nThe effects of preciousblock are not retained across restarts.\n", | ||||
{ | { | ||||
{"blockhash", RPCArg::Type::STR_HEX, RPCArg::Optional::NO, | {"blockhash", RPCArg::Type::STR_HEX, RPCArg::Optional::NO, | ||||
"the hash of the block to mark as precious"}, | "the hash of the block to mark as precious"}, | ||||
}, | }, | ||||
RPCResults{}, | RPCResult{RPCResult::Type::NONE, "", ""}, | ||||
RPCExamples{HelpExampleCli("preciousblock", "\"blockhash\"") + | RPCExamples{HelpExampleCli("preciousblock", "\"blockhash\"") + | ||||
HelpExampleRpc("preciousblock", "\"blockhash\"")}, | HelpExampleRpc("preciousblock", "\"blockhash\"")}, | ||||
} | } | ||||
.Check(request); | .Check(request); | ||||
BlockHash hash(ParseHashV(request.params[0], "blockhash")); | BlockHash hash(ParseHashV(request.params[0], "blockhash")); | ||||
CBlockIndex *pblockindex; | CBlockIndex *pblockindex; | ||||
Show All 21 Lines | RPCHelpMan{ | ||||
"Treats a block as final. It cannot be reorged. Any chain\n" | "Treats a block as final. It cannot be reorged. Any chain\n" | ||||
"that does not contain this block is invalid. Used on a less\n" | "that does not contain this block is invalid. Used on a less\n" | ||||
"work chain, it can effectively PUT YOU OUT OF CONSENSUS.\n" | "work chain, it can effectively PUT YOU OUT OF CONSENSUS.\n" | ||||
"USE WITH CAUTION!\n", | "USE WITH CAUTION!\n", | ||||
{ | { | ||||
{"blockhash", RPCArg::Type::STR_HEX, RPCArg::Optional::NO, | {"blockhash", RPCArg::Type::STR_HEX, RPCArg::Optional::NO, | ||||
"the hash of the block to mark as invalid"}, | "the hash of the block to mark as invalid"}, | ||||
}, | }, | ||||
RPCResults{}, | RPCResult{RPCResult::Type::NONE, "", ""}, | ||||
RPCExamples{HelpExampleCli("finalizeblock", "\"blockhash\"") + | RPCExamples{HelpExampleCli("finalizeblock", "\"blockhash\"") + | ||||
HelpExampleRpc("finalizeblock", "\"blockhash\"")}, | HelpExampleRpc("finalizeblock", "\"blockhash\"")}, | ||||
} | } | ||||
.Check(request); | .Check(request); | ||||
std::string strHash = request.params[0].get_str(); | std::string strHash = request.params[0].get_str(); | ||||
BlockHash hash(uint256S(strHash)); | BlockHash hash(uint256S(strHash)); | ||||
BlockValidationState state; | BlockValidationState state; | ||||
Show All 25 Lines | static UniValue invalidateblock(const Config &config, | ||||
RPCHelpMan{ | RPCHelpMan{ | ||||
"invalidateblock", | "invalidateblock", | ||||
"Permanently marks a block as invalid, as if it violated a consensus " | "Permanently marks a block as invalid, as if it violated a consensus " | ||||
"rule.\n", | "rule.\n", | ||||
{ | { | ||||
{"blockhash", RPCArg::Type::STR_HEX, RPCArg::Optional::NO, | {"blockhash", RPCArg::Type::STR_HEX, RPCArg::Optional::NO, | ||||
"the hash of the block to mark as invalid"}, | "the hash of the block to mark as invalid"}, | ||||
}, | }, | ||||
RPCResults{}, | RPCResult{RPCResult::Type::NONE, "", ""}, | ||||
RPCExamples{HelpExampleCli("invalidateblock", "\"blockhash\"") + | RPCExamples{HelpExampleCli("invalidateblock", "\"blockhash\"") + | ||||
HelpExampleRpc("invalidateblock", "\"blockhash\"")}, | HelpExampleRpc("invalidateblock", "\"blockhash\"")}, | ||||
} | } | ||||
.Check(request); | .Check(request); | ||||
const BlockHash hash(ParseHashV(request.params[0], "blockhash")); | const BlockHash hash(ParseHashV(request.params[0], "blockhash")); | ||||
BlockValidationState state; | BlockValidationState state; | ||||
Show All 21 Lines | |||||
UniValue parkblock(const Config &config, const JSONRPCRequest &request) { | UniValue parkblock(const Config &config, const JSONRPCRequest &request) { | ||||
RPCHelpMan{ | RPCHelpMan{ | ||||
"parkblock", | "parkblock", | ||||
"Marks a block as parked.\n", | "Marks a block as parked.\n", | ||||
{ | { | ||||
{"blockhash", RPCArg::Type::STR_HEX, RPCArg::Optional::NO, | {"blockhash", RPCArg::Type::STR_HEX, RPCArg::Optional::NO, | ||||
"the hash of the block to park"}, | "the hash of the block to park"}, | ||||
}, | }, | ||||
RPCResults{}, | RPCResult{RPCResult::Type::NONE, "", ""}, | ||||
RPCExamples{HelpExampleCli("parkblock", "\"blockhash\"") + | RPCExamples{HelpExampleCli("parkblock", "\"blockhash\"") + | ||||
HelpExampleRpc("parkblock", "\"blockhash\"")}, | HelpExampleRpc("parkblock", "\"blockhash\"")}, | ||||
} | } | ||||
.Check(request); | .Check(request); | ||||
const std::string strHash = request.params[0].get_str(); | const std::string strHash = request.params[0].get_str(); | ||||
const BlockHash hash(uint256S(strHash)); | const BlockHash hash(uint256S(strHash)); | ||||
BlockValidationState state; | BlockValidationState state; | ||||
Show All 25 Lines | RPCHelpMan{ | ||||
"reconsiderblock", | "reconsiderblock", | ||||
"Removes invalidity status of a block, its ancestors and its" | "Removes invalidity status of a block, its ancestors and its" | ||||
"descendants, reconsider them for activation.\n" | "descendants, reconsider them for activation.\n" | ||||
"This can be used to undo the effects of invalidateblock.\n", | "This can be used to undo the effects of invalidateblock.\n", | ||||
{ | { | ||||
{"blockhash", RPCArg::Type::STR_HEX, RPCArg::Optional::NO, | {"blockhash", RPCArg::Type::STR_HEX, RPCArg::Optional::NO, | ||||
"the hash of the block to reconsider"}, | "the hash of the block to reconsider"}, | ||||
}, | }, | ||||
RPCResults{}, | RPCResult{RPCResult::Type::NONE, "", ""}, | ||||
RPCExamples{HelpExampleCli("reconsiderblock", "\"blockhash\"") + | RPCExamples{HelpExampleCli("reconsiderblock", "\"blockhash\"") + | ||||
HelpExampleRpc("reconsiderblock", "\"blockhash\"")}, | HelpExampleRpc("reconsiderblock", "\"blockhash\"")}, | ||||
} | } | ||||
.Check(request); | .Check(request); | ||||
const BlockHash hash(ParseHashV(request.params[0], "blockhash")); | const BlockHash hash(ParseHashV(request.params[0], "blockhash")); | ||||
{ | { | ||||
Show All 21 Lines | RPCHelpMan{ | ||||
"unparkblock", | "unparkblock", | ||||
"Removes parked status of a block and its descendants, reconsider " | "Removes parked status of a block and its descendants, reconsider " | ||||
"them for activation.\n" | "them for activation.\n" | ||||
"This can be used to undo the effects of parkblock.\n", | "This can be used to undo the effects of parkblock.\n", | ||||
{ | { | ||||
{"blockhash", RPCArg::Type::STR_HEX, RPCArg::Optional::NO, | {"blockhash", RPCArg::Type::STR_HEX, RPCArg::Optional::NO, | ||||
"the hash of the block to unpark"}, | "the hash of the block to unpark"}, | ||||
}, | }, | ||||
RPCResults{}, | RPCResult{RPCResult::Type::NONE, "", ""}, | ||||
RPCExamples{HelpExampleCli("unparkblock", "\"blockhash\"") + | RPCExamples{HelpExampleCli("unparkblock", "\"blockhash\"") + | ||||
HelpExampleRpc("unparkblock", "\"blockhash\"")}, | HelpExampleRpc("unparkblock", "\"blockhash\"")}, | ||||
} | } | ||||
.Check(request); | .Check(request); | ||||
const std::string strHash = request.params[0].get_str(); | const std::string strHash = request.params[0].get_str(); | ||||
const BlockHash hash(uint256S(strHash)); | const BlockHash hash(uint256S(strHash)); | ||||
▲ Show 20 Lines • Show All 432 Lines • ▼ Show 20 Lines | |||||
static UniValue savemempool(const Config &config, | static UniValue savemempool(const Config &config, | ||||
const JSONRPCRequest &request) { | const JSONRPCRequest &request) { | ||||
RPCHelpMan{ | RPCHelpMan{ | ||||
"savemempool", | "savemempool", | ||||
"Dumps the mempool to disk. It will fail until the previous dump is " | "Dumps the mempool to disk. It will fail until the previous dump is " | ||||
"fully loaded.\n", | "fully loaded.\n", | ||||
{}, | {}, | ||||
RPCResults{}, | RPCResult{RPCResult::Type::NONE, "", ""}, | ||||
RPCExamples{HelpExampleCli("savemempool", "") + | RPCExamples{HelpExampleCli("savemempool", "") + | ||||
HelpExampleRpc("savemempool", "")}, | HelpExampleRpc("savemempool", "")}, | ||||
} | } | ||||
.Check(request); | .Check(request); | ||||
const CTxMemPool &mempool = EnsureMemPool(request.context); | const CTxMemPool &mempool = EnsureMemPool(request.context); | ||||
if (!mempool.IsLoaded()) { | if (!mempool.IsLoaded()) { | ||||
▲ Show 20 Lines • Show All 534 Lines • Show Last 20 Lines |