Merge pull request #10196 from ziggie1984/refactor-payment-part-6

refactor payments part 6
This commit is contained in:
Yong authored and GitHub committed 2025-09-08 15:40:36 +08:00
commit 6c9e0f348c
7 files changed
+147 -93

No files matched your search

+8 -3
View File
@@ -7523,10 +7523,15 @@ func (r *rpcServer) ListPayments(ctx context.Context,
CreationDateEnd: int64(req.CreationDateEnd),
}
// If the maximum number of payments wasn't specified, then we'll
// default to return the maximal number of payments representable.
// If the maximum number of payments wasn't specified, we default to
// a reasonable number to prevent resource exhaustion. All of the
// payments are fetched into memory. Moreover we don't want our daemon
// to remain stable and do other stuff rather than serving payments.
//
// TODO(ziggie): Choose a more specific default value when results of
// performance testing are available.
if req.MaxPayments == 0 {
query.MaxPayments = math.MaxUint64
query.MaxPayments = paymentsdb.DefaultMaxPayments
}
paymentsQuerySlice, err := r.server.paymentsDB.QueryPayments(