mirror of
https://github.com/lightningnetwork/lnd.git
synced 2025-07-12 14:12:27 +02:00
sqldb: add AMP invoices SQL schema
Schema for AMP invocies. AMP invoices can be paid multiple times and each payment to an AMP invoice is identified by a `set_id`. The A in AMP stands for `Atomic`. All the htlcs belonging to the same AMP payment (share the same set_id) will be resolved at the same time with the same result: settled/canceled. AMP invoices do not have an "invoice preimage". Instead, each htcl has its own hash/preimage. When a new htlc is added the hash for that htlc is attached to it. When all the htlcs of a set_id have been received we are able to compute the preimage for each one of them.
This commit is contained in:
8
sqldb/sqlc/migrations/000002_amp_invoices.down.sql
Normal file
8
sqldb/sqlc/migrations/000002_amp_invoices.down.sql
Normal file
@ -0,0 +1,8 @@
|
||||
DROP INDEX IF EXISTS amp_htlcs_htlc_id_idx;
|
||||
DROP INDEX IF EXISTS amp_htlcs_invoice_id_idx;
|
||||
DROP INDEX IF EXISTS amp_htlcs_set_id_idx;
|
||||
DROP TABLE IF EXISTS amp_invoice_htlcs;
|
||||
|
||||
DROP INDEX IF EXISTS amp_invoice_payments_invoice_id_idx;
|
||||
DROP TABLE IF EXISTS amp_invoice_payments;
|
||||
|
Reference in New Issue
Block a user