Bugfix: Require OrderedTxItems to provide properly scoped accounting entry list
OrderedTxItems returns a multimap of pointers, but needs a place to store the actual CAccountingEntries it points to. It had been using a stack item, which was clobbered as soon as it returned, resulting in undefined behaviour. This fixes at least bug #1768.
This commit is contained in:
@@ -987,7 +987,8 @@ Value listtransactions(const Array& params, bool fHelp)
|
||||
|
||||
Array ret;
|
||||
|
||||
CWallet::TxItems txOrdered = pwalletMain->OrderedTxItems(strAccount);
|
||||
std::list<CAccountingEntry> acentries;
|
||||
CWallet::TxItems txOrdered = pwalletMain->OrderedTxItems(acentries, strAccount);
|
||||
|
||||
// iterate backwards until we have nCount items to return:
|
||||
for (CWallet::TxItems::reverse_iterator it = txOrdered.rbegin(); it != txOrdered.rend(); ++it)
|
||||
|
||||
Reference in New Issue
Block a user