mirror of
https://github.com/bitcoin/bitcoin.git
synced 2026-05-31 08:13:52 +02:00
Guard CBlockIndex::nStatus/nFile/nDataPos/nUndoPos by cs_main
Co-authored-by: Vasil Dimov <vd@FreeBSD.org>
This commit is contained in:
@@ -240,7 +240,8 @@ static RPCHelpMan getrawtransaction()
|
||||
if (!tx) {
|
||||
std::string errmsg;
|
||||
if (blockindex) {
|
||||
if (!(blockindex->nStatus & BLOCK_HAVE_DATA)) {
|
||||
const bool block_has_data = WITH_LOCK(::cs_main, return blockindex->nStatus & BLOCK_HAVE_DATA);
|
||||
if (!block_has_data) {
|
||||
throw JSONRPCError(RPC_MISC_ERROR, "Block not available");
|
||||
}
|
||||
errmsg = "No such transaction found in the provided block";
|
||||
|
||||
Reference in New Issue
Block a user