Skip to content

Commit

Permalink
Fix blocks_til_maturity not showing in UI
Browse files Browse the repository at this point in the history
  • Loading branch information
jamaljsr committed Feb 15, 2019
1 parent a4ad7e5 commit f2c9229
Showing 1 changed file with 11 additions and 5 deletions.
16 changes: 11 additions & 5 deletions src/app/lib/lnd-http/index.ts
Expand Up @@ -89,6 +89,12 @@ export class LndHttpClient {
pending_open_channels: [],
}
).then(res => {
const collapse = (chan: any) => ({
...chan,
...chan.channel,
// remove nested 'channel' key from the chan spread
...{ channel: undefined },
});
res.pending_open_channels = res.pending_open_channels.map(channel => ({
status: T.CHANNEL_STATUS.OPENING,
commit_weight: '0',
Expand All @@ -98,23 +104,23 @@ export class LndHttpClient {
remote_balance: '0',
local_balance: '0',
capacity: '0',
...(channel as any).channel,
...collapse(channel),
}));
res.pending_closing_channels = res.pending_closing_channels.map(channel => ({
status: T.CHANNEL_STATUS.CLOSING,
closing_txid: channel.closing_txid,
closing_txid: '',
remote_balance: '0',
local_balance: '0',
capacity: '0',
...(channel as any).channel,
...collapse(channel),
}));
res.waiting_close_channels = res.waiting_close_channels.map(channel => ({
status: T.CHANNEL_STATUS.WAITING,
limbo_balance: '0',
remote_balance: '0',
local_balance: '0',
capacity: '0',
...(channel as any).channel,
...collapse(channel),
}));
res.pending_force_closing_channels = res.pending_force_closing_channels.map(channel => ({
status: T.CHANNEL_STATUS.FORCE_CLOSING,
Expand All @@ -126,7 +132,7 @@ export class LndHttpClient {
remote_balance: '0',
local_balance: '0',
capacity: '0',
...(channel as any).channel,
...collapse(channel),
}));
return res;
});
Expand Down

0 comments on commit f2c9229

Please sign in to comment.