Skip to content
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

Merged
merged 8 commits into from Feb 6, 2019

Conversation

Projects
None yet
3 participants
@joostjager
Copy link
Collaborator

commented Jan 11, 2019

This PR builds on top of #2356. Review that PR first.

@joostjager joostjager changed the title Cancelinvoice [NO REVIEW] invoices: CancelInvoice [NO REVIEW] Jan 11, 2019

@joostjager joostjager force-pushed the joostjager:cancelinvoice branch 5 times, most recently from 9033d36 to 59ade67 Jan 14, 2019

@joostjager joostjager changed the title invoices: CancelInvoice [NO REVIEW] invoices: CancelInvoice Jan 14, 2019

@joostjager joostjager force-pushed the joostjager:cancelinvoice branch 6 times, most recently from 50e6cdc to 08e9007 Jan 14, 2019

@Roasbeef Roasbeef added this to the 0.6 milestone Jan 16, 2019

@joostjager joostjager requested a review from cfromknecht Jan 21, 2019

@joostjager joostjager force-pushed the joostjager:cancelinvoice branch 5 times, most recently from c86e158 to 36da109 Jan 21, 2019

@joostjager joostjager force-pushed the joostjager:cancelinvoice branch 3 times, most recently from 3a5c437 to 81a95f8 Jan 29, 2019

@joostjager

This comment has been minimized.

Copy link
Collaborator Author

commented Jan 29, 2019

@Roasbeef ptal

@cfromknecht
Copy link
Collaborator

left a comment

@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

Show resolved Hide resolved htlcswitch/link.go Outdated
Show resolved Hide resolved htlcswitch/link.go Outdated
Show resolved Hide resolved htlcswitch/mock.go
Show resolved Hide resolved invoices/invoiceregistry.go Outdated
Show resolved Hide resolved invoices/invoiceregistry_test.go Outdated
Show resolved Hide resolved cmd/lncli/invoicesrpc_active.go Outdated
Show resolved Hide resolved channeldb/invoices.go
Show resolved Hide resolved lnrpc/invoicesrpc/invoices_server.go
Show resolved Hide resolved lnrpc/invoicesrpc/utils.go Outdated
Show resolved Hide resolved htlcswitch/mock.go Outdated

@joostjager joostjager force-pushed the joostjager:cancelinvoice branch from 3eeac06 to 4eda8d5 Jan 30, 2019

@joostjager

This comment has been minimized.

Copy link
Collaborator Author

commented Jan 30, 2019

Rebased on top of master with go-acc. Coverage reports shows cancel logic in link being hit.

ptal @cfromknecht

@joostjager joostjager force-pushed the joostjager:cancelinvoice branch 2 times, most recently from c9d78d1 to ed40d53 Feb 1, 2019

@joostjager

This comment has been minimized.

Copy link
Collaborator Author

commented Feb 1, 2019

@Roasbeef

This comment has been minimized.

Copy link
Member

commented Feb 2, 2019

Can be rebased now with single invoice in.

@Roasbeef
Copy link
Member

left a comment

LGTM 🦑

Show resolved Hide resolved htlcswitch/link_test.go

@joostjager joostjager force-pushed the joostjager:cancelinvoice branch 2 times, most recently from d269ee6 to 81d0922 Feb 3, 2019

@joostjager

This comment has been minimized.

Copy link
Collaborator Author

commented Feb 3, 2019

@Roasbeef stale review rejected by rebase

@cfromknecht unknown invoice cancel test added

ptal

@joostjager joostjager force-pushed the joostjager:cancelinvoice branch from 81d0922 to a0b3fa3 Feb 4, 2019

@cfromknecht
Copy link
Collaborator

left a comment

LGTM 🤓 one final nit re: logging

@@ -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 " +

This comment has been minimized.

Copy link
@cfromknecht

cfromknecht Feb 4, 2019

Collaborator

Should use l.errorf instead so that the short channel id is prepended to the log message

This comment has been minimized.

Copy link
@joostjager

joostjager Feb 5, 2019

Author Collaborator

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.

@joostjager joostjager force-pushed the joostjager:cancelinvoice branch from a0b3fa3 to 8324604 Feb 5, 2019

@joostjager

This comment has been minimized.

Copy link
Collaborator Author

commented Feb 5, 2019

@cfromknecht @Roasbeef
last comment addressed.
ptal

@Roasbeef

This comment has been minimized.

Copy link
Member

commented Feb 6, 2019

Needs rebase, something else went it before it.

joostjager added some commits Jan 11, 2019

@joostjager joostjager force-pushed the joostjager:cancelinvoice branch from 8324604 to a8baa23 Feb 6, 2019

@joostjager

This comment has been minimized.

Copy link
Collaborator Author

commented Feb 6, 2019

Rebased ptal

@Roasbeef Roasbeef merged commit 27cfdf9 into lightningnetwork:master Feb 6, 2019

2 checks passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details
coverage/coveralls Coverage increased (+0.08%) to 59.738%
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.