aboutsummaryrefslogtreecommitdiff
path: root/src/walletdb.cpp
diff options
context:
space:
mode:
authorCozz Lovan <cozzlovan@yahoo.com>2014-08-14 16:15:09 +0200
committerCozz Lovan <cozzlovan@yahoo.com>2014-08-14 16:19:04 +0200
commitda2ede2aa68ba14e1228b61e41a5840669560eee (patch)
treef0046ed62152f02ecbe10dfd0c9b0524a5f48a08 /src/walletdb.cpp
parent7accb7dbad6bef0c98dc436d164f27189294eaf5 (diff)
[Wallet] Improve ReorderTransactions(..)
Diffstat (limited to 'src/walletdb.cpp')
-rw-r--r--src/walletdb.cpp9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/walletdb.cpp b/src/walletdb.cpp
index a95baf83d0..d55ed374c5 100644
--- a/src/walletdb.cpp
+++ b/src/walletdb.cpp
@@ -278,8 +278,12 @@ CWalletDB::ReorderTransactions(CWallet* pwallet)
nOrderPos = nOrderPosNext++;
nOrderPosOffsets.push_back(nOrderPos);
- if (pacentry)
- // Have to write accounting regardless, since we don't keep it in memory
+ if (pwtx)
+ {
+ if (!WriteTx(pwtx->GetHash(), *pwtx))
+ return DB_LOAD_FAIL;
+ }
+ else
if (!WriteAccountingEntry(pacentry->nEntryNo, *pacentry))
return DB_LOAD_FAIL;
}
@@ -308,6 +312,7 @@ CWalletDB::ReorderTransactions(CWallet* pwallet)
return DB_LOAD_FAIL;
}
}
+ WriteOrderPosNext(nOrderPosNext);
return DB_LOAD_OK;
}