invoices: ensure AMP subinvoices are correctly updated w/nativesql

This commit is contained in:
Alex Akselrod 2024-08-29 16:41:50 -07:00 committed by Andras Banki-Horvath
parent e3a939aa0d
commit ffbdcc1d5d
No known key found for this signature in database
GPG Key ID: 80E5375C094198D8

View File

@ -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
}