MCPcopy Create free account
hub / github.com/WaykiChain/WaykiChain / getmininginfo

Function getmininginfo

src/rpc/rpcmining.cpp:98–129  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

96}
97
98Value getmininginfo(const Array& params, bool fHelp) {
99 if (fHelp || params.size() != 0) {
100 throw runtime_error(
101 "getmininginfo\n"
102 "\nReturns a json object containing mining-related information."
103 "\nResult:\n"
104 "{\n"
105 " \"blocks\": nnn, (numeric) The current block\n"
106 " \"currentblocksize\": nnn, (numeric) The last block size\n"
107 " \"currentblocktx\": nnn, (numeric) The last block transaction\n"
108 " \"errors\": \"...\" (string) Current errors\n"
109 " \"generate\": true|false (boolean) If the generation is on or off (see getgenerate or setgenerate "
110 "calls)\n"
111 " \"pooledtx\": n (numeric) The size of the mem pool\n"
112 " \"testnet\": true|false (boolean) If using testnet or not\n"
113 "}\n"
114 "\nExamples:\n" +
115 HelpExampleCli("getmininginfo", "") + "\nAs json rpc call\n" + HelpExampleRpc("getmininginfo", ""));
116 }
117
118 Object obj;
119 obj.push_back(Pair("blocks", chainActive.Height()));
120 obj.push_back(Pair("currentblocksize", (uint64_t)nLastBlockSize));
121 obj.push_back(Pair("currentblocktx", (uint64_t)nLastBlockTx));
122 obj.push_back(Pair("errors", GetWarnings("statusbar")));
123 obj.push_back(Pair("genblocklimit", 1));
124 obj.push_back(Pair("pooledtx", (uint64_t)mempool.Size()));
125 obj.push_back(Pair("nettype", NetTypeNames[SysCfg().NetworkID()]));
126 obj.push_back(Pair("posmaxnonce", (int32_t)SysCfg().GetBlockMaxNonce()));
127 obj.push_back(Pair("generate", GetMiningInfo()));
128 return obj;
129}
130
131Value submitblock(const Array& params, bool fHelp) {
132 if (fHelp || params.size() < 1 || params.size() > 2)

Callers

nothing calls this directly

Calls 11

HelpExampleCliFunction · 0.85
HelpExampleRpcFunction · 0.85
PairClass · 0.85
GetWarningsFunction · 0.85
GetMiningInfoFunction · 0.85
push_backMethod · 0.80
HeightMethod · 0.80
sizeMethod · 0.45
SizeMethod · 0.45
NetworkIDMethod · 0.45
GetBlockMaxNonceMethod · 0.45

Tested by

no test coverage detected