Changeset View
Changeset View
Standalone View
Standalone View
src/rpc/mining.cpp
Show All 26 Lines | |||||
#include <script/descriptor.h> | #include <script/descriptor.h> | ||||
#include <script/script.h> | #include <script/script.h> | ||||
#include <shutdown.h> | #include <shutdown.h> | ||||
#include <txmempool.h> | #include <txmempool.h> | ||||
#include <univalue.h> | #include <univalue.h> | ||||
#include <util/strencodings.h> | #include <util/strencodings.h> | ||||
#include <util/string.h> | #include <util/string.h> | ||||
#include <util/system.h> | #include <util/system.h> | ||||
#include <util/translation.h> | |||||
#include <validation.h> | #include <validation.h> | ||||
#include <validationinterface.h> | #include <validationinterface.h> | ||||
#include <warnings.h> | #include <warnings.h> | ||||
#include <cstdint> | #include <cstdint> | ||||
/** | /** | ||||
* Return average network hashes per second based on the last 'lookup' blocks, | * Return average network hashes per second based on the last 'lookup' blocks, | ||||
▲ Show 20 Lines • Show All 465 Lines • ▼ Show 20 Lines | static UniValue getmininginfo(const Config &config, | ||||
} | } | ||||
if (BlockAssembler::m_last_block_num_txs) { | if (BlockAssembler::m_last_block_num_txs) { | ||||
obj.pushKV("currentblocktx", *BlockAssembler::m_last_block_num_txs); | obj.pushKV("currentblocktx", *BlockAssembler::m_last_block_num_txs); | ||||
} | } | ||||
obj.pushKV("difficulty", double(GetDifficulty(::ChainActive().Tip()))); | obj.pushKV("difficulty", double(GetDifficulty(::ChainActive().Tip()))); | ||||
obj.pushKV("networkhashps", getnetworkhashps(config, request)); | obj.pushKV("networkhashps", getnetworkhashps(config, request)); | ||||
obj.pushKV("pooledtx", uint64_t(mempool.size())); | obj.pushKV("pooledtx", uint64_t(mempool.size())); | ||||
obj.pushKV("chain", config.GetChainParams().NetworkIDString()); | obj.pushKV("chain", config.GetChainParams().NetworkIDString()); | ||||
obj.pushKV("warnings", GetWarnings(false)); | obj.pushKV("warnings", GetWarnings(false).original); | ||||
return obj; | return obj; | ||||
} | } | ||||
// NOTE: Unlike wallet RPC (which use BCH values), mining RPCs follow GBT (BIP | // NOTE: Unlike wallet RPC (which use BCH values), mining RPCs follow GBT (BIP | ||||
// 22) in using satoshi amounts | // 22) in using satoshi amounts | ||||
static UniValue prioritisetransaction(const Config &config, | static UniValue prioritisetransaction(const Config &config, | ||||
const JSONRPCRequest &request) { | const JSONRPCRequest &request) { | ||||
RPCHelpMan{ | RPCHelpMan{ | ||||
▲ Show 20 Lines • Show All 646 Lines • Show Last 20 Lines |