mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-01-25 10:43:19 -03:00
rpc: reduce LOCK(cs_main) scope in gettxoutproof
This commit is contained in:
parent
4d92b5aaba
commit
d7f61e7d59
1 changed files with 2 additions and 2 deletions
|
@ -84,13 +84,13 @@ static RPCHelpMan gettxoutproof()
|
|||
g_txindex->BlockUntilSyncedToCurrentChain();
|
||||
}
|
||||
|
||||
LOCK(cs_main);
|
||||
|
||||
if (pblockindex == nullptr) {
|
||||
const CTransactionRef tx = GetTransaction(/*block_index=*/nullptr, /*mempool=*/nullptr, *setTxids.begin(), chainman.GetConsensus(), hashBlock);
|
||||
if (!tx || hashBlock.IsNull()) {
|
||||
throw JSONRPCError(RPC_INVALID_ADDRESS_OR_KEY, "Transaction not yet in block");
|
||||
}
|
||||
|
||||
LOCK(cs_main);
|
||||
pblockindex = chainman.m_blockman.LookupBlockIndex(hashBlock);
|
||||
if (!pblockindex) {
|
||||
throw JSONRPCError(RPC_INTERNAL_ERROR, "Transaction index corrupt");
|
||||
|
|
Loading…
Add table
Reference in a new issue