Changeset View
Changeset View
Standalone View
Standalone View
src/rpc/mining.cpp
Show First 20 Lines • Show All 530 Lines • ▼ Show 20 Lines | return RPCHelpMan{ | ||||
const JSONRPCRequest &request) -> UniValue { | const JSONRPCRequest &request) -> UniValue { | ||||
NodeContext &node = EnsureAnyNodeContext(request.context); | NodeContext &node = EnsureAnyNodeContext(request.context); | ||||
const CTxMemPool &mempool = EnsureMemPool(node); | const CTxMemPool &mempool = EnsureMemPool(node); | ||||
ChainstateManager &chainman = EnsureChainman(node); | ChainstateManager &chainman = EnsureChainman(node); | ||||
LOCK(cs_main); | LOCK(cs_main); | ||||
const CChain &active_chain = chainman.ActiveChain(); | const CChain &active_chain = chainman.ActiveChain(); | ||||
UniValue obj(UniValue::VOBJ); | UniValue obj(UniValue::VOBJ); | ||||
obj.pushKV("blocks", int(active_chain.Height())); | obj.pushKV("blocks", active_chain.Height()); | ||||
if (BlockAssembler::m_last_block_size) { | if (BlockAssembler::m_last_block_size) { | ||||
obj.pushKV("currentblocksize", | obj.pushKV("currentblocksize", | ||||
*BlockAssembler::m_last_block_size); | *BlockAssembler::m_last_block_size); | ||||
} | } | ||||
if (BlockAssembler::m_last_block_num_txs) { | if (BlockAssembler::m_last_block_num_txs) { | ||||
obj.pushKV("currentblocktx", | obj.pushKV("currentblocktx", | ||||
*BlockAssembler::m_last_block_num_txs); | *BlockAssembler::m_last_block_num_txs); | ||||
} | } | ||||
▲ Show 20 Lines • Show All 707 Lines • Show Last 20 Lines |