diff --git a/rpc.cpp b/rpc.cpp index 85f8b02216..d6a92b3463 100644 --- a/rpc.cpp +++ b/rpc.cpp @@ -1119,7 +1119,8 @@ Value listtransactions(const Array& params, bool fHelp) } // Now: iterate backwards until we have nCount items to return: - for (TxItems::reverse_iterator it = txByTime.rbegin(), std::advance(it, nFrom); it != txByTime.rend(); ++it) + TxItems::reverse_iterator it = txByTime.rbegin(); + for (std::advance(it, nFrom); it != txByTime.rend(); ++it) { CWalletTx *const pwtx = (*it).second.first; if (pwtx != 0)