mirror of
https://github.com/bitcoin/bitcoin.git
synced 2026-03-24 22:45:41 +01:00
rpc: Add EnsureArgsman helper
This commit is contained in:
@@ -37,6 +37,19 @@ CTxMemPool& EnsureAnyMemPool(const std::any& context)
|
||||
return EnsureMemPool(EnsureAnyNodeContext(context));
|
||||
}
|
||||
|
||||
ArgsManager& EnsureArgsman(const NodeContext& node)
|
||||
{
|
||||
if (!node.args) {
|
||||
throw JSONRPCError(RPC_INTERNAL_ERROR, "Node args not found");
|
||||
}
|
||||
return *node.args;
|
||||
}
|
||||
|
||||
ArgsManager& EnsureAnyArgsman(const std::any& context)
|
||||
{
|
||||
return EnsureArgsman(EnsureAnyNodeContext(context));
|
||||
}
|
||||
|
||||
ChainstateManager& EnsureChainman(const NodeContext& node)
|
||||
{
|
||||
if (!node.chainman) {
|
||||
|
||||
Reference in New Issue
Block a user