{
if (fHelp || params.size() > 2)
throw runtime_error(
- "listtransactions [account] [count=10]\n"
- "Returns up to [count] most recent transactions for account <account>.");
+ "listtransactions [account] [count=10] [from=0]\n"
+ "Returns up to [count] most recent transactions skipping the first [from] transactions for account [account].");
string strAccount = "*";
if (params.size() > 0)
int nCount = 10;
if (params.size() > 1)
nCount = params[1].get_int();
+ int nFrom = 0;
+ if (params.size() > 2)
+ nFrom = params[2].get_int();
Array ret;
CWalletDB walletdb;
}
// Now: iterate backwards until we have nCount items to return:
- for (TxItems::reverse_iterator it = txByTime.rbegin(); it != txByTime.rend(); ++it)
+ for (TxItems::reverse_iterator it = txByTime.rbegin(), std::advance(it, nFrom); it != txByTime.rend(); ++it)
{
CWalletTx *const pwtx = (*it).second.first;
if (pwtx != 0)