mirror of
https://github.com/ElementsProject/elements.git
synced 2026-08-20 13:37:28 +02:00
Merge 470664f2b7 into merged_master (Bitcoin PR #17746)
This commit is contained in:
commit
54b93c4315
1 changed files with 4 additions and 17 deletions
|
|
@ -1722,23 +1722,10 @@ UniValue listtransactions(const JSONRPCRequest& request)
|
|||
if ((nFrom + nCount) > (int)ret.size())
|
||||
nCount = ret.size() - nFrom;
|
||||
|
||||
std::vector<UniValue> arrTmp = ret.getValues();
|
||||
|
||||
std::vector<UniValue>::iterator first = arrTmp.begin();
|
||||
std::advance(first, nFrom);
|
||||
std::vector<UniValue>::iterator last = arrTmp.begin();
|
||||
std::advance(last, nFrom+nCount);
|
||||
|
||||
if (last != arrTmp.end()) arrTmp.erase(last, arrTmp.end());
|
||||
if (first != arrTmp.begin()) arrTmp.erase(arrTmp.begin(), first);
|
||||
|
||||
std::reverse(arrTmp.begin(), arrTmp.end()); // Return oldest to newest
|
||||
|
||||
ret.clear();
|
||||
ret.setArray();
|
||||
ret.push_backV(arrTmp);
|
||||
|
||||
return ret;
|
||||
const std::vector<UniValue>& txs = ret.getValues();
|
||||
UniValue result{UniValue::VARR};
|
||||
result.push_backV({ txs.rend() - nFrom - nCount, txs.rend() - nFrom }); // Return oldest to newest
|
||||
return result;
|
||||
}
|
||||
|
||||
static UniValue listsinceblock(const JSONRPCRequest& request)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue