diff options
| author | Gavin Andresen <[email protected]> | 2011-08-12 15:39:12 -0400 |
|---|---|---|
| committer | Gavin Andresen <[email protected]> | 2011-08-12 15:39:12 -0400 |
| commit | eb72eae304a7067eb568437c66c4d831b075dab9 (patch) | |
| tree | 966774b518927f3a3d62a806295788f050a85504 /src/rpc.cpp | |
| parent | Merge pull request #458 from TheBlueMatt/copyright (diff) | |
| download | discoin-eb72eae304a7067eb568437c66c4d831b075dab9.tar.xz discoin-eb72eae304a7067eb568437c66c4d831b075dab9.zip | |
Don't std::advance past beginning of transactions array. Fixes #465
Diffstat (limited to 'src/rpc.cpp')
| -rw-r--r-- | src/rpc.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/rpc.cpp b/src/rpc.cpp index d62a0d9ac..fdb57b3b8 100644 --- a/src/rpc.cpp +++ b/src/rpc.cpp @@ -1188,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) |