aboutsummaryrefslogtreecommitdiff
path: root/src/rpcwallet.cpp
diff options
context:
space:
mode:
authorPieter Wuille <pieter.wuille@gmail.com>2012-11-13 23:52:37 +0100
committerPieter Wuille <pieter.wuille@gmail.com>2012-11-14 00:31:56 +0100
commit4291e8feab308cb9c7840d74fc7aacf137a7c21f (patch)
treefd2376f4546dfd496dbd8367e5536ee47dae5304 /src/rpcwallet.cpp
parenteb49457ff279721cc3cef10fe68fd75b4aa71833 (diff)
Prevent RPC 'move' from deadlocking
It seemed to create two CWalletDB objects that both grab the database lock.
Diffstat (limited to 'src/rpcwallet.cpp')
-rw-r--r--src/rpcwallet.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/rpcwallet.cpp b/src/rpcwallet.cpp
index cc2e8ab46b..9e914f336d 100644
--- a/src/rpcwallet.cpp
+++ b/src/rpcwallet.cpp
@@ -573,7 +573,7 @@ Value movecmd(const Array& params, bool fHelp)
// Debit
CAccountingEntry debit;
- debit.nOrderPos = pwalletMain->IncOrderPosNext();
+ debit.nOrderPos = pwalletMain->IncOrderPosNext(&walletdb);
debit.strAccount = strFrom;
debit.nCreditDebit = -nAmount;
debit.nTime = nNow;
@@ -583,7 +583,7 @@ Value movecmd(const Array& params, bool fHelp)
// Credit
CAccountingEntry credit;
- credit.nOrderPos = pwalletMain->IncOrderPosNext();
+ credit.nOrderPos = pwalletMain->IncOrderPosNext(&walletdb);
credit.strAccount = strTo;
credit.nCreditDebit = nAmount;
credit.nTime = nNow;