mirror of
https://github.com/bitcoin/bitcoin.git
synced 2024-11-20 10:38:42 +01:00
rpc: Reduce cs_main lock in listunspent
This commit is contained in:
parent
979150bc23
commit
d76962e056
@ -3149,9 +3149,13 @@ UniValue listunspent(const JSONRPCRequest& request)
|
||||
|
||||
UniValue results(UniValue::VARR);
|
||||
std::vector<COutput> vecOutputs;
|
||||
LOCK2(cs_main, pwallet->cs_wallet);
|
||||
{
|
||||
LOCK2(cs_main, pwallet->cs_wallet);
|
||||
pwallet->AvailableCoins(vecOutputs, !include_unsafe, nullptr, nMinimumAmount, nMaximumAmount, nMinimumSumAmount, nMaximumCount, nMinDepth, nMaxDepth);
|
||||
}
|
||||
|
||||
LOCK(pwallet->cs_wallet);
|
||||
|
||||
pwallet->AvailableCoins(vecOutputs, !include_unsafe, nullptr, nMinimumAmount, nMaximumAmount, nMinimumSumAmount, nMaximumCount, nMinDepth, nMaxDepth);
|
||||
for (const COutput& out : vecOutputs) {
|
||||
CTxDestination address;
|
||||
const CScript& scriptPubKey = out.tx->tx->vout[out.i].scriptPubKey;
|
||||
|
Loading…
Reference in New Issue
Block a user