diff options
author | Cozz Lovan <cozzlovan@yahoo.com> | 2014-08-14 16:15:09 +0200 |
---|---|---|
committer | Cozz Lovan <cozzlovan@yahoo.com> | 2014-08-14 16:19:04 +0200 |
commit | da2ede2aa68ba14e1228b61e41a5840669560eee (patch) | |
tree | f0046ed62152f02ecbe10dfd0c9b0524a5f48a08 | |
parent | 7accb7dbad6bef0c98dc436d164f27189294eaf5 (diff) | |
download | bitcoin-da2ede2aa68ba14e1228b61e41a5840669560eee.tar.xz |
[Wallet] Improve ReorderTransactions(..)
-rw-r--r-- | src/walletdb.cpp | 9 |
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; } |