aboutsummaryrefslogtreecommitdiff
path: root/src/bitcoinrpc.cpp
diff options
context:
space:
mode:
authorWladimir J. van der Laan <[email protected]>2011-08-16 10:28:24 +0200
committerWladimir J. van der Laan <[email protected]>2011-08-16 10:28:24 +0200
commitb90c9ecb132ad686275afafe506f8044719245ec (patch)
treefc805f0c16b23faff1eb10b46da132e8c1951712 /src/bitcoinrpc.cpp
parentMerge branch 'master' of https://github.com/bitcoin/bitcoin (diff)
parentDon't std::advance past beginning of transactions array. Fixes #465 (diff)
downloaddiscoin-b90c9ecb132ad686275afafe506f8044719245ec.tar.xz
discoin-b90c9ecb132ad686275afafe506f8044719245ec.zip
Merge branch 'master' of https://github.com/bitcoin/bitcoin
Diffstat (limited to 'src/bitcoinrpc.cpp')
-rw-r--r--src/bitcoinrpc.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/bitcoinrpc.cpp b/src/bitcoinrpc.cpp
index c8248fa4f..d49f89882 100644
--- a/src/bitcoinrpc.cpp
+++ b/src/bitcoinrpc.cpp
@@ -1,4 +1,5 @@
// Copyright (c) 2010 Satoshi Nakamoto
+// Copyright (c) 2011 The Bitcoin developers
// Distributed under the MIT/X11 software license, see the accompanying
// file license.txt or http://www.opensource.org/licenses/mit-license.php.
@@ -1187,7 +1188,8 @@ Value listtransactions(const Array& params, bool fHelp)
// Now: iterate backwards until we have nCount items to return:
TxItems::reverse_iterator it = txByTime.rbegin();
- for (std::advance(it, nFrom); it != txByTime.rend(); ++it)
+ if (txByTime.size() > nFrom) std::advance(it, nFrom);
+ for (; it != txByTime.rend(); ++it)
{
CWalletTx *const pwtx = (*it).second.first;
if (pwtx != 0)