From ffbdcc1d5dcfa207cce4f43005d2923c48ad3cc2 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 c6a58c77b..09bb91170 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 }