aboutsummaryrefslogtreecommitdiff
path: root/src/wallet.cpp
diff options
context:
space:
mode:
authorGavin Andresen <gavinandresen@gmail.com>2012-11-16 08:09:41 -0800
committerGavin Andresen <gavinandresen@gmail.com>2012-11-16 08:09:41 -0800
commite45d39f9ee9ef776a32d398d973351e7c94f3f38 (patch)
tree78bf4b8ec7045bce354f4f1c01ee60a641ad9bc5 /src/wallet.cpp
parent1fefd2a5bc8eb3a95c12e260f554c6dcfbb1773c (diff)
parent4291e8feab308cb9c7840d74fc7aacf137a7c21f (diff)
downloadbitcoin-e45d39f9ee9ef776a32d398d973351e7c94f3f38.tar.xz
Merge pull request #2009 from sipa/fixmove
Prevent RPC 'move' from deadlocking
Diffstat (limited to 'src/wallet.cpp')
-rw-r--r--src/wallet.cpp10
1 files changed, 7 insertions, 3 deletions
diff --git a/src/wallet.cpp b/src/wallet.cpp
index 0115e56b8e..3bfb24832b 100644
--- a/src/wallet.cpp
+++ b/src/wallet.cpp
@@ -291,10 +291,14 @@ bool CWallet::EncryptWallet(const SecureString& strWalletPassphrase)
return true;
}
-int64 CWallet::IncOrderPosNext()
+int64 CWallet::IncOrderPosNext(CWalletDB *pwalletdb)
{
- int64 nRet = nOrderPosNext;
- CWalletDB(strWalletFile).WriteOrderPosNext(++nOrderPosNext);
+ int64 nRet = nOrderPosNext++;
+ if (pwalletdb) {
+ pwalletdb->WriteOrderPosNext(nOrderPosNext);
+ } else {
+ CWalletDB(strWalletFile).WriteOrderPosNext(nOrderPosNext);
+ }
return nRet;
}