channeldb: convert settled boolean to state
This commit is a preparation for the addition of new invoice states. A database migration is not needed because we keep the same field length and values.
This commit is contained in:
8 files changed
+88
-46
No files matched your search
+2
-2
@@ -720,11 +720,11 @@ func (i *mockInvoiceRegistry) SettleInvoice(rhash chainhash.Hash,
|
||||
return fmt.Errorf("can't find mock invoice: %x", rhash[:])
|
||||
}
|
||||
|
||||
if invoice.Terms.Settled {
|
||||
if invoice.Terms.State == channeldb.ContractSettled {
|
||||
return nil
|
||||
}
|
||||
|
||||
invoice.Terms.Settled = true
|
||||
invoice.Terms.State = channeldb.ContractSettled
|
||||
invoice.AmtPaid = amt
|
||||
i.invoices[rhash] = invoice
|
||||
|
||||
|
||||
Reference in new issue
Block a user