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/wallet.h | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'src/wallet.h') diff --git a/src/wallet.h b/src/wallet.h index 9103aa675e..65d3448212 100644 --- a/src/wallet.h +++ b/src/wallet.h @@ -146,7 +146,12 @@ public: typedef std::pair TxPair; typedef std::multimap TxItems; - TxItems OrderedTxItems(std::string strAccount = ""); + + /** Get the wallet's activity log + @return multimap of ordered transactions and accounting entries + @warning Returned pointers are *only* valid within the scope of passed acentries + */ + TxItems OrderedTxItems(std::list& acentries, std::string strAccount = ""); void MarkDirty(); bool AddToWallet(const CWalletTx& wtxIn); -- cgit v1.2.3