paymentsdb: enhance some godoc function descriptions
What changed, and why it matters
This commit only improves the explanatory text (godoc comments) above several internal database helper functions. No program logic, queries, or behavior were changed. It is purely a documentation cleanup and has no security relevance.
No action required. This is a non-functional documentation change.
Security signals we found
No strong security signals were identified.
Evidence from the diff
The diff modifies only Go doc comments in payments/db/sql_store.go, adding phrases such as ‘It uses a batch query to fetch all …’ to function descriptions. There are no code, query, or control-flow changes. The functions involved (loadPaymentCustomRecords, loadHtlcAttempts, loadHopsForAttempts, loadHopCustomRecords, loadRouteCustomRecords, loadPaymentsBatchData) remain operationally identical.
Changed components
payments/db/sql_store.go documentation onlyInspect captured patch +10 / −4
diff --git a/payments/db/sql_store.go b/payments/db/sql_store.go
index 1b7bfba..72fac39 100644
--- a/payments/db/sql_store.go
+++ b/payments/db/sql_store.go
@@ -151,7 +151,8 @@ type paymentsBatchData struct {
}
// loadPaymentCustomRecords loads payment-level custom records for a given
-// set of payment IDs.
+// set of payment IDs. It uses a batch query to fetch all custom records for
+// the given payment IDs.
func (s *SQLStore) loadPaymentCustomRecords(ctx context.Context,
db SQLQueries, paymentIDs []int64,
batchData *paymentsBatchData) error {
@@ -184,7 +185,8 @@ func (s *SQLStore) loadPaymentCustomRecords(ctx context.Context,
}
// loadHtlcAttempts loads HTLC attempts for all payments and returns all
-// attempt indices.
+// attempt indices. It uses a batch query to fetch all attempts for the given
+// payment IDs.
func (s *SQLStore) loadHtlcAttempts(ctx context.Context, db SQLQueries,
paymentIDs []int64, batchData *paymentsBatchData) ([]int64, error) {
@@ -216,6 +218,7 @@ func (s *SQLStore) loadHtlcAttempts(ctx context.Context, db SQLQueries,
}
// loadHopsForAttempts loads hops for all attempts and returns all hop IDs.
+// It uses a batch query to fetch all hops for the given attempt indices.
func (s *SQLStore) loadHopsForAttempts(ctx context.Context, db SQLQueries,
attemptIndices []int64, batchData *paymentsBatchData) ([]int64, error) {
@@ -247,7 +250,8 @@ func (s *SQLStore) loadHopsForAttempts(ctx context.Context, db SQLQueries,
return hopIDs, err
}
-// loadHopCustomRecords loads hop-level custom records for all hops.
+// loadHopCustomRecords loads hop-level custom records for all hops. It uses
+// a batch query to fetch all custom records for the given hop IDs.
func (s *SQLStore) loadHopCustomRecords(ctx context.Context, db SQLQueries,
hopIDs []int64, batchData *paymentsBatchData) error {
@@ -280,7 +284,8 @@ func (s *SQLStore) loadHopCustomRecords(ctx context.Context, db SQLQueries,
}
// loadRouteCustomRecords loads route-level first hop custom records for all
-// attempts.
+// attempts. It uses a batch query to fetch all custom records for the given
+// attempt indices.
func (s *SQLStore) loadRouteCustomRecords(ctx context.Context, db SQLQueries,
attemptIndices []int64, batchData *paymentsBatchData) error {
@@ -309,6 +314,7 @@ func (s *SQLStore) loadRouteCustomRecords(ctx context.Context, db SQLQueries,
}
// loadPaymentsBatchData loads all related data for multiple payments in batch.
+// It uses a batch queries to fetch all data for the given payment IDs.
func (s *SQLStore) loadPaymentsBatchData(ctx context.Context, db SQLQueries,
paymentIDs []int64) (*paymentsBatchData, error) {
Why this scored 15/100
Community notes
Notes can correct, qualify, or add evidence to the AI analysis. Every note shown here has been validated by a human moderator.
The AI analysis stands alone for now. Submit a note if you can add evidence or important context.