Skip to content
Open
Changes from 1 commit
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
6 changes: 2 additions & 4 deletions src/lib/lightning/lnd/mappers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,10 @@ import { PendingChannel } from 'shared/lndDefaults';
import { LightningNodeChannel } from 'lib/lightning/types';
import { snakeKeysToCamel } from 'utils/objects';

const txid = (channelPoint: string) => channelPoint.split(':')[0];

export const mapOpenChannel = (chan: LND.Channel): LightningNodeChannel => {
return {
pending: false,
uniqueId: txid(chan.channelPoint).slice(-12),
uniqueId: chan.channelPoint.replace(':', '-'),
channelPoint: chan.channelPoint,
pubkey: chan.remotePubkey,
capacity: chan.capacity,
Expand All @@ -25,7 +23,7 @@ export const mapPendingChannel =
(status: LightningNodeChannel['status']) =>
(chan: PendingChannel): LightningNodeChannel => ({
pending: true,
uniqueId: txid(chan.channelPoint).slice(-12),
uniqueId: chan.channelPoint.replace(':', '-'),
channelPoint: chan.channelPoint,
pubkey: chan.remoteNodePub,
capacity: chan.capacity,
Expand Down