aboutsummaryrefslogtreecommitdiff
path: root/src/wallet
diff options
context:
space:
mode:
authorMarcoFalke <falke.marco@gmail.com>2018-07-28 11:09:58 -0400
committerMarcoFalke <falke.marco@gmail.com>2018-07-29 08:04:06 -0400
commitfa5ed4f8d2c4cb3507bcc2460725d483f2e5789c (patch)
tree0dabe170ab89702055257cf214ab1de431aa4a9b /src/wallet
parentad51e1372bc645fc8710da2bc9e0a9fc6c0f27bb (diff)
downloadbitcoin-fa5ed4f8d2c4cb3507bcc2460725d483f2e5789c.tar.xz
refactor: Avoid locking tx pool cs thrice
Diffstat (limited to 'src/wallet')
-rw-r--r--src/wallet/wallet.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/wallet/wallet.cpp b/src/wallet/wallet.cpp
index 4918100b30..bb048949ca 100644
--- a/src/wallet/wallet.cpp
+++ b/src/wallet/wallet.cpp
@@ -3018,7 +3018,8 @@ bool CWallet::CreateTransaction(const std::vector<CRecipient>& vecSend, CTransac
size_t nLimitDescendants = gArgs.GetArg("-limitdescendantcount", DEFAULT_DESCENDANT_LIMIT);
size_t nLimitDescendantSize = gArgs.GetArg("-limitdescendantsize", DEFAULT_DESCENDANT_SIZE_LIMIT)*1000;
std::string errString;
- if (!mempool.CalculateMemPoolAncestors(entry, setAncestors, nLimitAncestors, nLimitAncestorSize, nLimitDescendants, nLimitDescendantSize, errString)) {
+ LOCK(::mempool.cs);
+ if (!::mempool.CalculateMemPoolAncestors(entry, setAncestors, nLimitAncestors, nLimitAncestorSize, nLimitDescendants, nLimitDescendantSize, errString)) {
strFailReason = _("Transaction has too long of a mempool chain");
return false;
}