fix: short channel id in connection details#1002
Merged
Merged
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 37ee77d4b8
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
ovitrif
reviewed
Jun 9, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #702
This PR corrects the Channel ID shown on the Lightning Connection Details screen so it displays the short channel ID in Core Lightning
block x tx x outputform (for example777477x916x0) instead of the 64-character internal channel ID, which is far longer than the short channel IDs people expect.Description
The short channel ID comes from the node for open channels, as a numeric BOLT scid that is decoded into
block x tx x outputform. Closed channels are not stored with one, so it falls back to the short channel ID from a confidently linked Blocktank or CJIT order (matched by funding transaction or order id, not a loose counterparty guess). Blocktank already delivers that value inblock x tx x outputform, so it is kept as-is; a numeric value is still decoded as a safeguard. The Channel ID row is hidden when no value is available, rather than showing the internal identifier.This is a port of the iOS fix in synonymdev/bitkit-ios#587. The channel point was already correct on Android — it already reads the funding outpoint (
funding_txid:vout) from the channel's own data and hides the row when unavailable — so this change is limited to the Channel ID.A reusable
ULong.formattedAsShortChannelId()extension decodes the numeric BOLT scid (block height in the high 24 bits, transaction index in the next 24, funding output index in the low 16).Preview
https://mempool.bitkit.stag0.blocktank.to/tx/bf7168f068c77d9588f35c2463ce0168bad719678969670592efc755dcdf9ee3#vout=0
cjit-channel.webm
https://mempool.bitkit.stag0.blocktank.to/tx/bf7168f068c77d9588f35c2463ce0168bad719678969670592efc755dcdf9ee3#vout=0
normal-order.webm
closed-order.webm
QA Notes
Manual Tests
regression:Channel Detail → Channel point row: shows the funding outpoint (funding_txid:vout) matching the Order Details Transaction.regression:Channel Detail → tap Channel point row: copies the value.Automated Checks
app/src/test/java/to/bitkit/ext/ShortChannelIdTest.kt, including the issue's numeric854845001888432128→777477x916x0decode, the closed-channel fallback keeping Blocktank's already-formatted792906x599x1, and malformed/empty values returning nothing.just test file ShortChannelIdTest,just compile, andjust lintpass.