multi: return txns first and last indices

In this commit we introduce first and last indices for the
tranasctions returned which can be used to seek for further
transactions in a pagination style.

Signed-off-by: Abdullahi Yunus <abdoollahikbk@gmail.com>
This commit is contained in:
Abdullahi Yunus committed 2024-11-22 08:22:55 +01:00
1 parent cd1df4ac34
commit 762d01536b
13 files changed
+3135 -3044

No files matched your search

+6 -5
View File
@@ -6476,15 +6476,16 @@ func (r *rpcServer) GetTransactions(ctx context.Context,
endHeight = req.EndHeight
}
transactions, err := r.server.cc.Wallet.ListTransactionDetails(
req.StartHeight, endHeight, req.Account, req.IndexOffset,
req.MaxTransactions,
)
txns, firstIdx, lastIdx, err :=
r.server.cc.Wallet.ListTransactionDetails(
req.StartHeight, endHeight, req.Account,
req.IndexOffset, req.MaxTransactions,
)
if err != nil {
return nil, err
}
return lnrpc.RPCTransactionDetails(transactions), nil
return lnrpc.RPCTransactionDetails(txns, firstIdx, lastIdx), nil
}
// DescribeGraph returns a description of the latest graph state from the PoV