Merge 915ac8a861 into merged_master (Bitcoin PR #19413)

This commit is contained in:
Andrew Poelstra 2020-11-26 01:09:19 +00:00
commit 8e770d3f21
7 changed files with 37 additions and 42 deletions

View file

@ -1641,11 +1641,12 @@ UniValue testproposedblock(const JSONRPCRequest& request)
if (!DecodeHexBlk(block, request.params[0].get_str()))
throw JSONRPCError(RPC_DESERIALIZATION_ERROR, "Block decode failed");
ChainstateManager& chainman = EnsureChainman(request.context);
LOCK(cs_main);
uint256 hash = block.GetHash();
BlockMap::iterator mi = ::BlockIndex().find(hash);
if (mi != ::BlockIndex().end())
BlockMap::iterator mi = chainman.BlockIndex().find(hash);
if (mi != chainman.BlockIndex().end())
throw JSONRPCError(RPC_VERIFY_ERROR, "already have block");
CBlockIndex* const pindexPrev = ::ChainActive().Tip();