-
Notifications
You must be signed in to change notification settings - Fork 152
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
fix(chart.ts): pending channel display bug #703
Conversation
@jamaljsr ALso, out of scope. Maybe a pending channel link could use the functionality to quickly confirm the channel with mining 6 blocks and refreshing the chart? WDT? |
Codecov ReportPatch coverage:
Additional details and impacted files@@ Coverage Diff @@
## master #703 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 116 116
Lines 3435 3437 +2
Branches 619 647 +28
=========================================
+ Hits 3435 3437 +2
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. ☔ View full report in Codecov by Sentry. |
Thanks for investigating and submitting this PR. While this solution does work in this specific scenario, it's not addressing the root cause of the problem. If you look at polar/src/lib/lightning/lnd/lndService.ts Lines 49 to 55 in 6445103
So when the chart links are being created, the same pending channel is present for both nodes. This causes the link created for alice to be overwritten by the link created for bob. Your fix does work because it prevents bob's channel from overwriting alice's, but now the inverse situation becomes a bug. Currently if you open the channel from bob to alice, the pending channel will show the correct source and destination. When using your fix, the bug returns as it now shows the source as alice, since bob's channel is being filtered out. The better solution here would be to address the root cause of the problem, which is that |
Thanks for the guidance, I was looking at this function for a period of time as a root cause but couldn't identify the solution you pointed out, I'll update this asap. |
src/lib/lightning/lnd/lndService.ts
Outdated
...closing.map(pluckChan).map(mapPendingChannel('Closing')), | ||
...forceClosing.map(pluckChan).map(mapPendingChannel('Force Closing')), | ||
...waitingClose.map(pluckChan).map(mapPendingChannel('Waiting to Close')), | ||
...open.filter(isChanInitiatorLocal).map(mapOpenChannel), |
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 won't work because LND.Channel.initiator
is a boolean
, but the isChanInitiatorLocal
function is comparing it to an enum
/number
. That function looks good for all of the pending arrays below, but the open channels array has a different type so it should be filtered differently.
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.
Ah ty!
The code looks good. I'll test it when I get a chance. Can you squash your commits into one and use a proper message prefix |
Tested and confirmed this resolves the issue. Just needs a squash then this can be merged. |
Fantastic, thanks for the guidance and feedback once again. |
filters by local initiator
f8cfac0
to
162f1e5
Compare
Channel info now displays proper source and dest names
for pending channels
Closes #699
Description
Channel links are proccessed twice resulting in data being clobbered.
Steps to Test
lncli openchannel <bob-pubkey> 100000
Screenshots
[Only if applicable]