-
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
invoices: CancelInvoice #2457
invoices: CancelInvoice #2457
Conversation
9033d36
to
59ade67
Compare
50e6cdc
to
08e9007
Compare
c86e158
to
36da109
Compare
3a5c437
to
81a95f8
Compare
@Roasbeef ptal |
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.
@joostjager completed an initial pass, design looks solid to me. also really like the refactorings made to the htlcswitch tests, as those have been in need of some love from a test framework perspective.
would be nice to rebase this on the master to visualize the channeldb coverage using go-acc, as right now the unit testing is separate from the implementation and appears uncovered
3eeac06
to
4eda8d5
Compare
Rebased on top of master with ptal @cfromknecht |
c9d78d1
to
ed40d53
Compare
@cfromknecht ptal |
Can be rebased now with single invoice in. |
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 🦑
d269ee6
to
81d0922
Compare
@Roasbeef stale review rejected by rebase @cfromknecht unknown invoice cancel test added ptal |
81d0922
to
a0b3fa3
Compare
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 final nit re: logging
htlcswitch/link.go
Outdated
@@ -2330,6 +2330,23 @@ func (l *channelLink) processRemoteAdds(fwdPkg *channeldb.FwdPkg, | |||
continue | |||
} | |||
|
|||
// Reject htlcs for canceled invoices. | |||
if invoice.Terms.State == channeldb.ContractCanceled { | |||
log.Errorf("Rejecting htlc due to canceled " + |
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.
Should use l.errorf
instead so that the short channel id is prepended to the log message
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 this, but noticed that in many other places l.errorf
isn't used. Also, I think error is not the right log level for something that can just happen normally. But don't want to tackle that in this pr.
a0b3fa3
to
8324604
Compare
@cfromknecht @Roasbeef |
Needs rebase, something else went it before it. |
8324604
to
a8baa23
Compare
Rebased ptal |
This PR builds on top of #2356. Review that PR first.