multi: terminate SubscribeSingleInvoice once completed

This commit is contained in:
carla
2021-04-14 09:19:23 +02:00
parent 0686329062
commit db1d671b1a
3 changed files with 19 additions and 0 deletions

View File

@@ -362,6 +362,11 @@ func (c ContractState) String() string {
return "Unknown"
}
// IsFinal returns a boolean indicating whether an invoice state is final
func (c ContractState) IsFinal() bool {
return c == ContractSettled || c == ContractCanceled
}
// ContractTerm is a companion struct to the Invoice struct. This struct houses
// the necessary conditions required before the invoice can be considered fully
// settled by the payee.