-
Notifications
You must be signed in to change notification settings - Fork 385
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
Expose next_channel_id
in PaymentForwarded
event
#1475
Expose next_channel_id
in PaymentForwarded
event
#1475
Conversation
9c35b7f
to
eb6a39d
Compare
Codecov Report
@@ Coverage Diff @@
## main #1475 +/- ##
========================================
Coverage 90.88% 90.88%
========================================
Files 75 76 +1
Lines 41474 42081 +607
Branches 41474 42081 +607
========================================
+ Hits 37695 38247 +552
- Misses 3779 3834 +55
Continue to review full report at Codecov.
|
Thanks for having a look at this! However, I'm not too sure if the change actually warrants this kind of refactoring? Also, not sure if it is just me, but every time I read |
Using the current approach all events are linked to an You're right about the different semantic use of Initially, I faced the confusion of nomenclature as well but I rationalized it because a node only knows about the prev/next nodes in the route. So for it the source and destination are the prev and next node, though I see how it is confusing. I added documentation to clarify what source/sink mean but if we still feel the naming is unintuitive, I'll update it. |
Generally we've been pretty open to this kind of refactoring in the past - its relatively trivial, most existing users don't implement this interface directly so won't even see it, but even if they do they won't have any trouble adapting to it. Its certainly a lot cleaner than changing the serialization format, IMO.
Hmm, fair enough. I'd suggested it as an alternative to "source+destination" which has that problem even worse, but I like your prev/next or incoming/outgoing suggestion. |
So I'll do a couple of things
Thanks for the feedback and being patient with me! It really helps especially because I'm new to FOSS, Bitcoin, Lightning, and Rust. |
e386e61
to
9e67447
Compare
sink_channel_id
in PaymentForwarded
eventnext_channel_id
in PaymentForwarded
event
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.
A few nits but this looks good to me 🚀
44ec53c
to
1bcdf98
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.
This looks good! Think I'm ACK after remaining feedback is addressed
1bcdf98
to
6e76064
Compare
Rebased |
6e76064
to
b60de85
Compare
This update also includes a minor refactor. The return type of `pending_monitor_events` has been changed to a `Vec` tuple with the `OutPoint` type. This associates a `Vec` of `MonitorEvent`s with a funding outpoint. We've also renamed `source/sink_channel_id` to `prev/next_channel_id` in the favour of clarity.
b60de85
to
1ae1de9
Compare
Closes #1391
There is a minor refactor included in this PR. The type of
pending_monitor_events
inchainmonitor
has been changed toHashMap<OutPoint, Vec<MonitorEvent>>
. This associates events with an outpoint, thereby removing the dependency in theMonitorEvent
enum to store the outpoint separately. One doubt I had is if the order of pending events matters. If it does, this approach will not work.