Skip to content

Commit

Permalink
fix(tapd): fix missing LND chart port from migration
Browse files Browse the repository at this point in the history
  • Loading branch information
jamaljsr committed May 24, 2023
1 parent ed82b18 commit 511569e
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/lib/docker/dockerService.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -383,6 +383,11 @@ describe('DockerService', () => {
// added in v2.0.0
delete net.autoMineMode;
delete net.nodes.tap;
net.nodes.lightning.forEach((n: any) => {
if (n.implementation === 'LND') {
delete chart.nodes[n.name].ports['lndbackend'];
}
});
return { net, chart };
};

Expand Down
10 changes: 10 additions & 0 deletions src/utils/migrations.ts
Original file line number Diff line number Diff line change
Expand Up @@ -172,6 +172,16 @@ const v200 = (file: NetworksFile): NetworksFile => {
debug(`${pre} add tap node list to network`);
network.nodes.tap = [];
}

network.nodes.lightning
.filter(n => n.implementation === 'LND')
.forEach(node => {
const chartNode = file.charts[network.id].nodes[node.name];
if (!chartNode.ports['lndbackend']) {
debug(`${pre} add lndbackend port to LND chart node ${node.name}`);
chartNode.ports['lndbackend'] = { id: 'lndbackend', type: 'top' };
}
});
});

return file;
Expand Down

0 comments on commit 511569e

Please sign in to comment.