aboutsummaryrefslogtreecommitdiff
path: root/src/rpcwallet.cpp
diff options
context:
space:
mode:
authorLuke Dashjr <luke-jr+git@utopios.org>2012-09-01 22:07:47 +0000
committerLuke Dashjr <luke-jr+git@utopios.org>2012-09-02 08:02:46 +0000
commitddb709e9de1490afcfa1af045517d2228d5b864c (patch)
tree46a8f68d95e38d527729e2b7da7976dad8654921 /src/rpcwallet.cpp
parentc3f95ef13f48d21db53992984976eac93e7a08fc (diff)
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.
Diffstat (limited to 'src/rpcwallet.cpp')
-rw-r--r--src/rpcwallet.cpp3
1 files changed, 2 insertions, 1 deletions
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<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)