From 4a3a3c7ad34121c3b1b662bbba5bbba77b2d6a6a Mon Sep 17 00:00:00 2001 From: Alex Akselrod Date: Thu, 29 Aug 2024 16:41:50 -0700 Subject: [PATCH] invoices: ensure AMP subinvoices are correctly updated w/nativesql --- invoices/sql_store.go | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/invoices/sql_store.go b/invoices/sql_store.go index c6a58c77b9..09bb911701 100644 --- a/invoices/sql_store.go +++ b/invoices/sql_store.go @@ -1283,6 +1283,13 @@ func (s *sqlInvoiceUpdater) UpdateAmpState(setID [32]byte, return err } + if settleIndex.Valid { + updatedState := s.invoice.AMPState[setID] + updatedState.SettleIndex = uint64(settleIndex.Int64) + updatedState.SettleDate = s.updateTime.UTC() + s.invoice.AMPState[setID] = updatedState + } + return nil }