diff options
Diffstat (limited to 'src/wallet.cpp')
-rw-r--r-- | src/wallet.cpp | 10 |
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; } |