Changeset View
Changeset View
Standalone View
Standalone View
src/rpc/blockchain.cpp
Show First 20 Lines • Show All 1,114 Lines • ▼ Show 20 Lines | UniValue gettxout(const Config &config, const JSONRPCRequest &request) { | ||||
ScriptPubKeyToJSON(config, coin.GetTxOut().scriptPubKey, o, true); | ScriptPubKeyToJSON(config, coin.GetTxOut().scriptPubKey, o, true); | ||||
ret.push_back(Pair("scriptPubKey", o)); | ret.push_back(Pair("scriptPubKey", o)); | ||||
ret.push_back(Pair("coinbase", coin.IsCoinBase())); | ret.push_back(Pair("coinbase", coin.IsCoinBase())); | ||||
return ret; | return ret; | ||||
} | } | ||||
UniValue verifychain(const Config &config, const JSONRPCRequest &request) { | UniValue verifychain(const Config &config, const JSONRPCRequest &request) { | ||||
int nCheckLevel = GetArg("-checklevel", DEFAULT_CHECKLEVEL); | int nCheckLevel = gArgs.GetArg("-checklevel", DEFAULT_CHECKLEVEL); | ||||
int nCheckDepth = GetArg("-checkblocks", DEFAULT_CHECKBLOCKS); | int nCheckDepth = gArgs.GetArg("-checkblocks", DEFAULT_CHECKBLOCKS); | ||||
if (request.fHelp || request.params.size() > 2) { | if (request.fHelp || request.params.size() > 2) { | ||||
throw std::runtime_error( | throw std::runtime_error( | ||||
"verifychain ( checklevel nblocks )\n" | "verifychain ( checklevel nblocks )\n" | ||||
"\nVerifies blockchain database.\n" | "\nVerifies blockchain database.\n" | ||||
"\nArguments:\n" | "\nArguments:\n" | ||||
"1. checklevel (numeric, optional, 0-4, default=" + | "1. checklevel (numeric, optional, 0-4, default=" + | ||||
strprintf("%d", nCheckLevel) + | strprintf("%d", nCheckLevel) + | ||||
") How thorough the block verification is.\n" | ") How thorough the block verification is.\n" | ||||
▲ Show 20 Lines • Show All 331 Lines • ▼ Show 20 Lines | |||||
} | } | ||||
UniValue mempoolInfoToJSON() { | UniValue mempoolInfoToJSON() { | ||||
UniValue ret(UniValue::VOBJ); | UniValue ret(UniValue::VOBJ); | ||||
ret.push_back(Pair("size", (int64_t)mempool.size())); | ret.push_back(Pair("size", (int64_t)mempool.size())); | ||||
ret.push_back(Pair("bytes", (int64_t)mempool.GetTotalTxSize())); | ret.push_back(Pair("bytes", (int64_t)mempool.GetTotalTxSize())); | ||||
ret.push_back(Pair("usage", (int64_t)mempool.DynamicMemoryUsage())); | ret.push_back(Pair("usage", (int64_t)mempool.DynamicMemoryUsage())); | ||||
size_t maxmempool = | size_t maxmempool = | ||||
GetArg("-maxmempool", DEFAULT_MAX_MEMPOOL_SIZE) * 1000000; | gArgs.GetArg("-maxmempool", DEFAULT_MAX_MEMPOOL_SIZE) * 1000000; | ||||
ret.push_back(Pair("maxmempool", (int64_t)maxmempool)); | ret.push_back(Pair("maxmempool", (int64_t)maxmempool)); | ||||
ret.push_back( | ret.push_back( | ||||
Pair("mempoolminfee", | Pair("mempoolminfee", | ||||
ValueFromAmount(mempool.GetMinFee(maxmempool).GetFeePerK()))); | ValueFromAmount(mempool.GetMinFee(maxmempool).GetFeePerK()))); | ||||
return ret; | return ret; | ||||
} | } | ||||
▲ Show 20 Lines • Show All 282 Lines • Show Last 20 Lines |