-
Notifications
You must be signed in to change notification settings - Fork 2.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
channeldb+lnrpc: invoice state #2354
Conversation
f6c8849
to
f890ff7
Compare
@@ -2334,7 +2334,7 @@ func (l *channelLink) processRemoteAdds(fwdPkg *channeldb.FwdPkg, | |||
// TODO(conner): track ownership of settlements to | |||
// properly recover from failures? or add batch invoice | |||
// settlement | |||
if invoice.Terms.Settled { | |||
if invoice.Terms.State != channeldb.ContractOpen { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this intended? Comment should possibly be updated to reflect change?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes. In this PR both are equivalent, but I am inverting the condition as a preparation for the hold invoice.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same for comment below
f890ff7
to
86e9ae7
Compare
comments processed |
also added |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM 🐝
One minor nit/clarification, but generally good on my end!
channeldb/invoices.go
Outdated
|
||
// ContractSettled means the htlc is settled and the invoice has been | ||
// paid. | ||
ContractSettled = 1 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this one also needs to be explicitly specified as the prior one isn't using iota
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed
86e9ae7
to
320b775
Compare
Ready to land after sign+rebase! (may need to sync with some of the other PRs that also modify |
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.
Expose the new invoice state field over rpc.
320b775
to
1199f17
Compare
Ptal @Roasbeef |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM 💯
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM 🍭
This PR converts the invoice
settled
boolean into a state. This is a preparation that enables creation of new invoice states.