diff options
| author | MarcoFalke <[email protected]> | 2020-06-14 14:17:24 -0400 |
|---|---|---|
| committer | MarcoFalke <[email protected]> | 2020-06-15 07:39:35 -0400 |
| commit | fab80fef61ddd4afeff6e497c7e76bffcd05e8a4 (patch) | |
| tree | 18eee04e36fc7dc2fc30c82da3608b7df4d2fca8 /src/rpc/blockchain.cpp | |
| parent | scripted-diff: Replace EnsureChainman with Assert in unit tests (diff) | |
| download | discoin-fab80fef61ddd4afeff6e497c7e76bffcd05e8a4.tar.xz discoin-fab80fef61ddd4afeff6e497c7e76bffcd05e8a4.zip | |
refactor: Remove unused EnsureChainman
Diffstat (limited to 'src/rpc/blockchain.cpp')
| -rw-r--r-- | src/rpc/blockchain.cpp | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/rpc/blockchain.cpp b/src/rpc/blockchain.cpp index 8252af3ee..cd1b27490 100644 --- a/src/rpc/blockchain.cpp +++ b/src/rpc/blockchain.cpp @@ -75,7 +75,10 @@ CTxMemPool& EnsureMemPool(const util::Ref& context) ChainstateManager& EnsureChainman(const util::Ref& 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. |