invoices: add method to create payment hash index
Certain invoices may not have a deterministic payment hash. For such invoices we still store the payment hashes in our KV database, but we do not have a sufficient index to retrieve them. This PR adds such index to the SQL database that will be used during migration to retrieve payment hashes.
This commit is contained in:
2 files changed
+139
No files matched your search
@@ -123,6 +123,17 @@ type SQLInvoiceQueries interface { //nolint:interfacebloat
|
||||
|
||||
OnAMPSubInvoiceSettled(ctx context.Context,
|
||||
arg sqlc.OnAMPSubInvoiceSettledParams) error
|
||||
|
||||
// Migration specific methods.
|
||||
// TODO(bhandras): remove this once migrations have been separated out.
|
||||
InsertKVInvoiceKeyAndAddIndex(ctx context.Context,
|
||||
arg sqlc.InsertKVInvoiceKeyAndAddIndexParams) error
|
||||
|
||||
SetKVInvoicePaymentHash(ctx context.Context,
|
||||
arg sqlc.SetKVInvoicePaymentHashParams) error
|
||||
|
||||
GetKVInvoicePaymentHashByAddIndex(ctx context.Context, addIndex int64) (
|
||||
[]byte, error)
|
||||
}
|
||||
|
||||
var _ InvoiceDB = (*SQLStore)(nil)
|
||||
|
||||
Reference in new issue
Block a user