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

ZEUS-2629: Failed payment to invoices with route hints #2662

Merged
merged 3 commits into from
Dec 23, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions locales/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -423,6 +423,7 @@
"views.Channel.confirmClose": "Confirm Channel Close",
"views.Channel.aliasScid": "Alias SCID",
"views.Channel.aliasScids": "Alias SCIDs",
"views.Channel.peerAliasScid": "Peer Alias SCID",
"views.Channel.closeHeight": "Close height",
"views.Channel.closeType": "Close type",
"views.Channel.openInitiator": "Open initiator",
Expand Down
1 change: 1 addition & 0 deletions models/Channel.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ export default class Channel extends BaseModel {
capacity: string;
private: boolean;
initiator?: boolean;
peer_scid_alias?: number;
alias_scids?: Array<number>; // array uint64
local_chan_reserve_sat?: string;
remote_chan_reserve_sat?: string;
Expand Down
4 changes: 3 additions & 1 deletion stores/InvoicesStore.ts
Original file line number Diff line number Diff line change
Expand Up @@ -268,7 +268,9 @@ export default class InvoicesStore {
hop_hints: [
{
node_id: routeHintChannel.remotePubkey,
chan_id: routeHintChannel.channelId, // must not be converted to Number as this might lead to a loss of precision
chan_id:
routeHintChannel.peer_scid_alias ||
routeHintChannel.channelId, // must not be converted to Number as this might lead to a loss of precision
fee_base_msat: Number(
remotePolicy?.fee_base_msat
),
Expand Down
35 changes: 27 additions & 8 deletions views/Channels/Channel.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -248,6 +248,7 @@ export default class ChannelView extends React.Component<
shortChannelId,
initiator,
alias_scids,
peer_scid_alias,
local_chan_reserve_sat,
remote_chan_reserve_sat,
displayName,
Expand Down Expand Up @@ -404,16 +405,34 @@ export default class ChannelView extends React.Component<
value={shortChannelId}
/>
)}
{!!alias_scids && alias_scids.length > 0 && (
{!!alias_scids &&
alias_scids.length > 0 &&
// hide if single SCID that matches channel ID
!(
alias_scids.length === 1 &&
alias_scids[0].toString() === channelId
) && (
<KeyValue
keyValue={
alias_scids.length > 1
? localeString(
'views.Channel.aliasScids'
)
: localeString(
'views.Channel.aliasScid'
)
}
value={PrivacyUtils.sensitiveValue(
alias_scids.join(', ')
)}
/>
)}
{!!peer_scid_alias && (
<KeyValue
keyValue={
alias_scids.length > 1
? localeString('views.Channel.aliasScids')
: localeString('views.Channel.aliasScid')
}
value={PrivacyUtils.sensitiveValue(
alias_scids.join(', ')
keyValue={localeString(
'views.Channel.peerAliasScid'
)}
value={PrivacyUtils.sensitiveValue(peer_scid_alias)}
/>
)}
{zero_conf && (
Expand Down
Loading