Skip to content

Commit d2e678d

Browse files
committed
Add CWallet::ReorderTransactions and use in accounting_tests.cpp
1 parent 59adc86 commit d2e678d

File tree

3 files changed

+8
-1
lines changed

3 files changed

+8
-1
lines changed

src/wallet/test/accounting_tests.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ GetResults(CWalletDB& walletdb, std::map<CAmount, CAccountingEntry>& results)
2222
std::list<CAccountingEntry> aes;
2323

2424
results.clear();
25-
BOOST_CHECK(walletdb.ReorderTransactions(pwalletMain) == DB_LOAD_OK);
25+
BOOST_CHECK(pwalletMain->ReorderTransactions() == DB_LOAD_OK);
2626
pwalletMain->ListAccountCreditDebit("", aes);
2727
BOOST_FOREACH(CAccountingEntry& ae, aes)
2828
{

src/wallet/wallet.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -649,6 +649,12 @@ bool CWallet::EncryptWallet(const SecureString& strWalletPassphrase)
649649
return true;
650650
}
651651

652+
DBErrors CWallet::ReorderTransactions()
653+
{
654+
CWalletDB walletdb(strWalletFile);
655+
return walletdb.ReorderTransactions(this);
656+
}
657+
652658
int64_t CWallet::IncOrderPosNext(CWalletDB *pwalletdb)
653659
{
654660
AssertLockHeld(cs_wallet); // nOrderPosNext

src/wallet/wallet.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -741,6 +741,7 @@ class CWallet : public CCryptoKeyStore, public CValidationInterface
741741
* @return next transaction order id
742742
*/
743743
int64_t IncOrderPosNext(CWalletDB *pwalletdb = NULL);
744+
DBErrors ReorderTransactions();
744745
bool AccountMove(std::string strFrom, std::string strTo, CAmount nAmount, std::string strComment = "");
745746
bool GetAccountPubkey(CPubKey &pubKey, std::string strAccount, bool bForceNew = false);
746747

0 commit comments

Comments
 (0)