aboutsummaryrefslogtreecommitdiff
path: root/src/walletdb.cpp
diff options
context:
space:
mode:
authorWladimir J. van der Laan <laanwj@gmail.com>2014-09-08 11:05:41 +0200
committerWladimir J. van der Laan <laanwj@gmail.com>2014-09-08 11:07:00 +0200
commit297998808a606936f45b371a978e3c2039b37cf6 (patch)
tree602721c9430fccda61880e3909aeb81e4102489f /src/walletdb.cpp
parent1f01b29c6fc2aa694b13a2aa1ff6ed8502bba64d (diff)
parentda2ede2aa68ba14e1228b61e41a5840669560eee (diff)
Merge pull request #4697
da2ede2 [Wallet] Improve ReorderTransactions(..) (Cozz Lovan)
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 2fa6071658..48045b98c8 100644
--- a/src/walletdb.cpp
+++ b/src/walletdb.cpp
@@ -281,8 +281,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;
}
@@ -311,6 +315,7 @@ CWalletDB::ReorderTransactions(CWallet* pwallet)
return DB_LOAD_FAIL;
}
}
+ WriteOrderPosNext(nOrderPosNext);
return DB_LOAD_OK;
}