Skip to content

Commit

Permalink
Merge pull request #2662 from kaloudis/zeus-2629
Browse files Browse the repository at this point in the history
ZEUS-2629: Failed payment to invoices with route hints
  • Loading branch information
kaloudis authored Dec 23, 2024
2 parents 6e1f78d + 9c1fc78 commit b6a0f29
Show file tree
Hide file tree
Showing 4 changed files with 32 additions and 9 deletions.
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

0 comments on commit b6a0f29

Please sign in to comment.