aboutsummaryrefslogtreecommitdiff
path: root/src/wallet.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/wallet.cpp')
-rw-r--r--src/wallet.cpp9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/wallet.cpp b/src/wallet.cpp
index f88a0e1413..880f7aa8bd 100644
--- a/src/wallet.cpp
+++ b/src/wallet.cpp
@@ -291,6 +291,13 @@ bool CWallet::EncryptWallet(const SecureString& strWalletPassphrase)
return true;
}
+int64 CWallet::IncOrderPosNext()
+{
+ int64 nRet = nOrderPosNext;
+ CWalletDB(strWalletFile).WriteOrderPosNext(++nOrderPosNext);
+ return nRet;
+}
+
CWallet::TxItems CWallet::OrderedTxItems(std::list<CAccountingEntry>& acentries, std::string strAccount)
{
CWalletDB walletdb(strWalletFile);
@@ -362,7 +369,7 @@ bool CWallet::AddToWallet(const CWalletTx& wtxIn)
if (fInsertedNew)
{
wtx.nTimeReceived = GetAdjustedTime();
- wtx.nOrderPos = nOrderPosNext++;
+ wtx.nOrderPos = IncOrderPosNext();
wtx.nTimeSmart = wtx.nTimeReceived;
if (wtxIn.hashBlock != 0)