lnwire+htlcswitch: report htlc accept height#3414
lnwire+htlcswitch: report htlc accept height#3414joostjager merged 5 commits intolightningnetwork:masterfrom
Conversation
630fe2a to
7de1e62
Compare
2ca1e27 to
ae146db
Compare
cfromknecht
left a comment
There was a problem hiding this comment.
first pass looks pretty good, only one rpc-related comment 👍
lnrpc/routerrpc/router.proto
Outdated
There was a problem hiding this comment.
perhaps something like accept_height, to mimic what the invoice htlc's will show?
There was a problem hiding this comment.
I thought about that, but wasn't sure. The idea of the message Failure is that it isn't a oneof to keep it simple. Fields are reused in different messages. This height is meant as a generic height field associated with a failure. But yes, I could also make it more specific.
ae146db to
eab6793
Compare
halseth
left a comment
There was a problem hiding this comment.
Looks more or less good to me :)
eab6793 to
ec8602b
Compare
ec8602b to
3894c26
Compare
cfromknecht
left a comment
There was a problem hiding this comment.
LGTM! great commit structure 👌
|
3894c26 to
91766ed
Compare
|
Test failure fixed |
invoices/invoiceregistry.go
Outdated
There was a problem hiding this comment.
add similar comment as for the settle case
There was a problem hiding this comment.
Comment added. While writing the comment, I also realized that the invoice update could be a bit stricter. See commit channeldb+invoices: make htlc cancelation stricter
343c376 to
81d6637
Compare
|
Requires #3503 to be merged so that the linter is tamed first. |
81d6637 to
783d9db
Compare
invoices/invoiceregistry.go
Outdated
There was a problem hiding this comment.
Does this mean that we can cancel a settled one?
There was a problem hiding this comment.
Discussed offline. No htlc should be in the settled state here, because then the invoice state would have been settled. Added extra check to return an error if this happens.
Previously it was possible to cancel a canceled htlc. This would subtract the htlc amount from the invoice amount again.
This commit modifies hodl htlc notification from invoice registry from a single notification per hash to distinct notifications per htlc. This prepares for htlc-specific information (accept height) to be added to the notification.
This is a preparation for passing back the accept height in the incorrect payment details failure message to the sender.
This test relied on specific internals of the failure encode function. Changes to failure message pointer receiver everywhere subtly broke this test.
Extends the invalid payment details failure with the new accept height field. This allows sender to distinguish between a genuine invalid details situation and a delay caused by intermediate nodes.
783d9db to
f60e4b1
Compare
Implements lightning/bolts#608 by extending the incorrect_or_unknown_payment_details message with the height at which the failed htlc was accepted.