Merge pull request #5207 from carlaKC/4727-singleinvoice

invoicesrpc: terminate SubscribeSingleInvoice once invoice reaches a final state
This commit is contained in:
Conner Fromknecht authored and GitHub committed 2021-04-14 15:32:53 -07:00
commit 748265d097
4 files changed
+425 -380

No files matched your search

+5
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.