diff --git a/locales/en.json b/locales/en.json index 2561ce3ce..6d4f16425 100644 --- a/locales/en.json +++ b/locales/en.json @@ -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", diff --git a/models/Channel.ts b/models/Channel.ts index 4e6cfe66b..280ff8e6e 100644 --- a/models/Channel.ts +++ b/models/Channel.ts @@ -42,6 +42,7 @@ export default class Channel extends BaseModel { capacity: string; private: boolean; initiator?: boolean; + peer_scid_alias?: number; alias_scids?: Array; // array uint64 local_chan_reserve_sat?: string; remote_chan_reserve_sat?: string; diff --git a/stores/InvoicesStore.ts b/stores/InvoicesStore.ts index beb6c51df..6ee74b316 100644 --- a/stores/InvoicesStore.ts +++ b/stores/InvoicesStore.ts @@ -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 ), diff --git a/views/Channels/Channel.tsx b/views/Channels/Channel.tsx index 23e69afc8..fab4b11c3 100644 --- a/views/Channels/Channel.tsx +++ b/views/Channels/Channel.tsx @@ -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, @@ -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 + ) && ( + 1 + ? localeString( + 'views.Channel.aliasScids' + ) + : localeString( + 'views.Channel.aliasScid' + ) + } + value={PrivacyUtils.sensitiveValue( + alias_scids.join(', ') + )} + /> + )} + {!!peer_scid_alias && ( 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 && (