rest: reduce LOCK(cs_main) scope in rest_block

This commit is contained in:
Andrew Toth committed 2022-12-06 15:07:04 -05:00
1 parent 0596aa40f7
commit c75e3d2772
1 file changed
+3 -1
+3 -1
View File
@@ -305,7 +305,9 @@ static bool rest_block(const std::any& context,
if (chainman.m_blockman.IsBlockPruned(pblockindex)) if (chainman.m_blockman.IsBlockPruned(pblockindex))
return RESTERR(req, HTTP_NOT_FOUND, hashStr + " not available (pruned data)"); return RESTERR(req, HTTP_NOT_FOUND, hashStr + " not available (pruned data)");
if (!ReadBlockFromDisk(block, pblockindex, chainman.GetParams().GetConsensus())) }
if (!ReadBlockFromDisk(block, pblockindex, chainman.GetParams().GetConsensus())) {
return RESTERR(req, HTTP_NOT_FOUND, hashStr + " not found"); return RESTERR(req, HTTP_NOT_FOUND, hashStr + " not found");
} }