Merge pull request #463 from TheBlueMatt/encreadme
[novacoin.git] / src / rpc.cpp
index dd3430d..62b2f82 100644 (file)
@@ -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)