File tree Expand file tree Collapse file tree 1 file changed +4
-17
lines changed Expand file tree Collapse file tree 1 file changed +4
-17
lines changed Original file line number Diff line number Diff line change @@ -1491,23 +1491,10 @@ UniValue listtransactions(const JSONRPCRequest& request)
1491
1491
if ((nFrom + nCount) > (int )ret.size ())
1492
1492
nCount = ret.size () - nFrom;
1493
1493
1494
- std::vector<UniValue> arrTmp = ret.getValues ();
1495
-
1496
- std::vector<UniValue>::iterator first = arrTmp.begin ();
1497
- std::advance (first, nFrom);
1498
- std::vector<UniValue>::iterator last = arrTmp.begin ();
1499
- std::advance (last, nFrom+nCount);
1500
-
1501
- if (last != arrTmp.end ()) arrTmp.erase (last, arrTmp.end ());
1502
- if (first != arrTmp.begin ()) arrTmp.erase (arrTmp.begin (), first);
1503
-
1504
- std::reverse (arrTmp.begin (), arrTmp.end ()); // Return oldest to newest
1505
-
1506
- ret.clear ();
1507
- ret.setArray ();
1508
- ret.push_backV (arrTmp);
1509
-
1510
- return ret;
1494
+ const std::vector<UniValue>& txs = ret.getValues ();
1495
+ UniValue result{UniValue::VARR};
1496
+ result.push_backV ({ txs.rend () - nFrom - nCount, txs.rend () - nFrom }); // Return oldest to newest
1497
+ return result;
1511
1498
}
1512
1499
1513
1500
static UniValue listsinceblock (const JSONRPCRequest& request)
You can’t perform that action at this time.
0 commit comments