Don't std::advance past beginning of transactions array. Fixes #465
This commit is contained in:
parent
498a2c9b16
commit
eb72eae304
1 changed files with 2 additions and 1 deletions
|
@ -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)
|
||||
|
|
Loading…
Reference in a new issue