Skip to content

Commit

Permalink
Add CWallet::ReorderTransactions and use in accounting_tests.cpp
Browse files Browse the repository at this point in the history
(cherry picked from commit d2e678d)
  • Loading branch information
pstratem authored and nuttycom committed Aug 10, 2021
1 parent 9dc4e4b commit a113057
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/wallet/test/accounting_tests.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ GetResults(CWalletDB& walletdb, std::map<CAmount, CAccountingEntry>& results)
std::list<CAccountingEntry> aes;

results.clear();
BOOST_CHECK(walletdb.ReorderTransactions(pwalletMain) == DB_LOAD_OK);
BOOST_CHECK(pwalletMain->ReorderTransactions() == DB_LOAD_OK);
pwalletMain->ListAccountCreditDebit("", aes);
for (CAccountingEntry& ae : aes)
{
Expand Down
6 changes: 6 additions & 0 deletions src/wallet/wallet.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1405,6 +1405,12 @@ bool CWallet::EncryptWallet(const SecureString& strWalletPassphrase)
return true;
}

DBErrors CWallet::ReorderTransactions()
{
CWalletDB walletdb(strWalletFile);
return walletdb.ReorderTransactions(this);
}

int64_t CWallet::IncOrderPosNext(CWalletDB *pwalletdb)
{
AssertLockHeld(cs_wallet); // nOrderPosNext
Expand Down
1 change: 1 addition & 0 deletions src/wallet/wallet.h
Original file line number Diff line number Diff line change
Expand Up @@ -1166,6 +1166,7 @@ class CWallet : public CCryptoKeyStore, public CValidationInterface
* @warning Returned pointers are *only* valid within the scope of passed acentries
*/
TxItems OrderedTxItems(std::list<CAccountingEntry>& acentries, std::string strAccount = "");
DBErrors ReorderTransactions();

void MarkDirty();
bool UpdateNullifierNoteMap();
Expand Down

0 comments on commit a113057

Please sign in to comment.