rest: reduce LOCK(cs_main) scope in rest_block

This commit is contained in:
Andrew Toth 2022-10-13 15:19:57 -04:00
parent 0596aa40f7
commit c75e3d2772

View File

@ -305,8 +305,10 @@ static bool rest_block(const std::any& context,
if (chainman.m_blockman.IsBlockPruned(pblockindex))
return RESTERR(req, HTTP_NOT_FOUND, hashStr + " not available (pruned data)");
if (!ReadBlockFromDisk(block, pblockindex, chainman.GetParams().GetConsensus()))
return RESTERR(req, HTTP_NOT_FOUND, hashStr + " not found");
}
if (!ReadBlockFromDisk(block, pblockindex, chainman.GetParams().GetConsensus())) {
return RESTERR(req, HTTP_NOT_FOUND, hashStr + " not found");
}
switch (rf) {