diff options
| author | João Barbosa <[email protected]> | 2018-05-03 11:31:21 +0100 |
|---|---|---|
| committer | João Barbosa <[email protected]> | 2018-05-03 11:31:21 +0100 |
| commit | d76962e05683ebf220996a82312b8e08f07bb4eb (patch) | |
| tree | c2f0000df8ddb7cf41c199066aef2b599a68b334 /src/wallet/rpcwallet.cpp | |
| parent | Merge #12729: Get rid of ambiguous OutputType::NONE value (diff) | |
| download | discoin-d76962e05683ebf220996a82312b8e08f07bb4eb.tar.xz discoin-d76962e05683ebf220996a82312b8e08f07bb4eb.zip | |
rpc: Reduce cs_main lock in listunspent
Diffstat (limited to 'src/wallet/rpcwallet.cpp')
| -rw-r--r-- | src/wallet/rpcwallet.cpp | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/wallet/rpcwallet.cpp b/src/wallet/rpcwallet.cpp index bfd9840df..5785cf909 100644 --- a/src/wallet/rpcwallet.cpp +++ b/src/wallet/rpcwallet.cpp @@ -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; |