mirror of
https://github.com/daywalker90/cln-nip47.git
synced 2026-08-13 12:33:43 +02:00
don't ignore offset in list_transactions
This commit is contained in:
parent
29e3debd06
commit
b1a33d40aa
2 changed files with 11 additions and 0 deletions
|
|
@ -10,6 +10,9 @@
|
|||
- missing fields for ``make_invoice`` response
|
||||
- new `fees_paid` field in ``pay_keysend``/``multi_pay_keysend``
|
||||
|
||||
### Fixed
|
||||
- Don't ignore `offset` parameter in ``list_transactions``
|
||||
|
||||
## [0.1.5] 2025-07-24
|
||||
|
||||
### Changed
|
||||
|
|
|
|||
|
|
@ -674,6 +674,14 @@ pub async fn list_transactions(
|
|||
|
||||
transactions.sort_by_key(|t| Reverse(t.created_at));
|
||||
|
||||
if let Some(off) = params.offset.map(|o| o as usize) {
|
||||
if off < transactions.len() {
|
||||
transactions.drain(0..off);
|
||||
} else {
|
||||
transactions.clear();
|
||||
}
|
||||
}
|
||||
|
||||
if let Some(l) = params.limit {
|
||||
if transactions.len() > (l as usize) {
|
||||
transactions = transactions.drain(0..(l as usize)).collect()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue