@@ -683,7 +683,7 @@ bool CWallet::AccountMove(std::string strFrom, std::string strTo, CAmount nAmoun
683683 debit.nTime = nNow;
684684 debit.strOtherAccount = strTo;
685685 debit.strComment = strComment;
686- AddAccountingEntry (debit, walletdb);
686+ AddAccountingEntry (debit, & walletdb);
687687
688688 // Credit
689689 CAccountingEntry credit;
@@ -693,7 +693,7 @@ bool CWallet::AccountMove(std::string strFrom, std::string strTo, CAmount nAmoun
693693 credit.nTime = nNow;
694694 credit.strOtherAccount = strFrom;
695695 credit.strComment = strComment;
696- AddAccountingEntry (credit, walletdb);
696+ AddAccountingEntry (credit, & walletdb);
697697
698698 if (!walletdb.TxnCommit ())
699699 return false ;
@@ -2512,9 +2512,16 @@ void CWallet::ListAccountCreditDebit(const std::string& strAccount, std::list<CA
25122512 return walletdb.ListAccountCreditDebit (strAccount, entries);
25132513}
25142514
2515- bool CWallet::AddAccountingEntry (const CAccountingEntry& acentry, CWalletDB & pwalletdb )
2515+ bool CWallet::AddAccountingEntry (const CAccountingEntry& acentry)
25162516{
2517- if (!pwalletdb.WriteAccountingEntry_Backend (acentry))
2517+ CWalletDB walletdb (strWalletFile);
2518+
2519+ return AddAccountingEntry (acentry, &walletdb);
2520+ }
2521+
2522+ bool CWallet::AddAccountingEntry (const CAccountingEntry& acentry, CWalletDB *pwalletdb)
2523+ {
2524+ if (!pwalletdb->WriteAccountingEntry_Backend (acentry))
25182525 return false ;
25192526
25202527 laccentries.push_back (acentry);
0 commit comments