From ddb709e9de1490afcfa1af045517d2228d5b864c Mon Sep 17 00:00:00 2001 From: Luke Dashjr Date: Sat, 1 Sep 2012 22:07:47 +0000 Subject: 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. --- src/rpcwallet.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/rpcwallet.cpp') diff --git a/src/rpcwallet.cpp b/src/rpcwallet.cpp index eacb5b3b1a..20df4c0a68 100644 --- a/src/rpcwallet.cpp +++ b/src/rpcwallet.cpp @@ -987,7 +987,8 @@ Value listtransactions(const Array& params, bool fHelp) Array ret; - CWallet::TxItems txOrdered = pwalletMain->OrderedTxItems(strAccount); + std::list 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) -- cgit v1.2.3