sqldb+invoices: add migration to fix incorrectly stored invoice expiries

Previously, when using the native schema, invoice expiries were incorrectly
stored as 64-bit values (expiry in nanoseconds instead of seconds), causing
overflow issues. Since we cannot determine the original values, we will set
the expiries for existing invoices to 1 hour with this migration.
This commit is contained in:
Andras Banki-Horvath
2024-06-21 19:08:15 +02:00
parent 3526f82b5d
commit 323af946e0
4 changed files with 21 additions and 3 deletions

View File

@@ -69,7 +69,7 @@ func randInvoice(value lnwire.MilliSatoshi) (*invpkg.Invoice, error) {
i := &invpkg.Invoice{
CreationDate: testNow,
Terms: invpkg.ContractTerm{
Expiry: 4000,
Expiry: time.Duration(4000) * time.Second,
PaymentPreimage: &pre,
PaymentAddr: payAddr,
Value: value,