Skip to content
This repository has been archived by the owner on Nov 17, 2023. It is now read-only.

Commit

Permalink
feat(ui): display timelock for force closing channels
Browse files Browse the repository at this point in the history
  • Loading branch information
mrfelton committed Oct 17, 2020
1 parent 64dea17 commit 4a9e582
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 2 deletions.
18 changes: 17 additions & 1 deletion renderer/components/Channels/ChannelData.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@ const ChannelData = ({ channel, cryptoUnitName, intl, networkInfo, viewMode, ...
totalSatoshisSent,
totalSatoshisReceived,
csvDelay,
maturityHeight,
blocksTilMaturity,
activity,
numUpdates,
fundingTxTimestamp,
Expand Down Expand Up @@ -135,6 +137,18 @@ const ChannelData = ({ channel, cryptoUnitName, intl, networkInfo, viewMode, ...
value: <Text>{csvDelay}</Text>,
}),

maturityHeight: () => ({
label: <FormattedMessage {...messages.maturity_height_label} />,
body: <FormattedMessage {...messages.maturity_height_description} />,
value: <Text>{maturityHeight}</Text>,
}),

blocksTilMaturity: () => ({
label: <FormattedMessage {...messages.blocks_til_maturity_label} />,
body: <FormattedMessage {...messages.blocks_til_maturity_description} />,
value: <Text>{blocksTilMaturity}</Text>,
}),

totalSatoshisSent: () => ({
label: <FormattedMessage {...messages.total_sent_label} />,
body: <FormattedMessage {...messages.total_sent_description} />,
Expand Down Expand Up @@ -194,11 +208,13 @@ const ChannelData = ({ channel, cryptoUnitName, intl, networkInfo, viewMode, ...
viewMode === CHANNEL_DATA_VIEW_MODE_BASIC
? [isClosing ? 'closingTxid' : 'channelPoint', 'numUpdates', 'csvDelay', 'activity']
: [
'channelPoint',
'fundingTxTimestamp',
'channelPoint',
'closingTxid',
'numUpdates',
'csvDelay',
'maturityHeight',
'blocksTilMaturity',
'activity',
'totalSatoshisSent',
'totalSatoshisReceived',
Expand Down
5 changes: 5 additions & 0 deletions renderer/components/Channels/messages.js
Original file line number Diff line number Diff line change
Expand Up @@ -118,4 +118,9 @@ export default defineMessages({
no_search_results: 'Your search did not return any results.',
crypto_amount_with_unit: '{amount} {cryptoUnitName}',
channels_filter_hint: 'Channels filter',
maturity_height_label: 'Maturity height',
maturity_height_description: 'The height at which funds can be swept into the wallet.',
blocks_til_maturity_label: 'Blocks til maturity',
blocks_til_maturity_description:
'Remaining # of blocks until the commitment output can be swept. Negative values indicate how many blocks have passed since becoming mature.',
})
4 changes: 3 additions & 1 deletion renderer/reducers/channels/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,9 @@ import { getNodeDisplayName } from 'reducers/network'
* @param {object} channelObj Channel object
* @returns {object} Channel data
*/
export const getChannelData = channelObj => channelObj.channel || channelObj
export const getChannelData = channelObj => {
return channelObj.channel ? { ...channelObj, ...channelObj.channel } : channelObj
}

/**
* getRemoteNodePubKey - Get the remote pubkey depending on what type of channel.
Expand Down

0 comments on commit 4a9e582

Please sign in to comment.