Changeset View
Changeset View
Standalone View
Standalone View
src/rpc/blockchain.cpp
Show First 20 Lines • Show All 64 Lines • ▼ Show 20 Lines | if (!node.mempool) { | ||||
throw JSONRPCError(RPC_CLIENT_MEMPOOL_DISABLED, | throw JSONRPCError(RPC_CLIENT_MEMPOOL_DISABLED, | ||||
"Mempool disabled or instance not found"); | "Mempool disabled or instance not found"); | ||||
} | } | ||||
return *node.mempool; | return *node.mempool; | ||||
} | } | ||||
ChainstateManager &EnsureChainman(const util::Ref &context) { | ChainstateManager &EnsureChainman(const util::Ref &context) { | ||||
NodeContext &node = EnsureNodeContext(context); | NodeContext &node = EnsureNodeContext(context); | ||||
return EnsureChainman(node); | if (!node.chainman) { | ||||
throw JSONRPCError(RPC_INTERNAL_ERROR, "Node chainman not found"); | |||||
} | |||||
return *node.chainman; | |||||
} | } | ||||
/** | /** | ||||
* Calculate the difficulty for a given block index. | * Calculate the difficulty for a given block index. | ||||
*/ | */ | ||||
double GetDifficulty(const CBlockIndex *blockindex) { | double GetDifficulty(const CBlockIndex *blockindex) { | ||||
CHECK_NONFATAL(blockindex); | CHECK_NONFATAL(blockindex); | ||||
▲ Show 20 Lines • Show All 2,877 Lines • Show Last 20 Lines |