diff options
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 dd3430d42f..62b2f82fb1 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) |