@@ -6,6 +6,7 @@ const url = require('url');
66const isDev = require ( 'electron-is-dev' ) ;
77const log = require ( 'electron-log' ) ;
88const { startLndProcess, startBtcdProcess } = require ( './lnd-child-process' ) ;
9+ const { parseCliArg } = require ( './helper' ) ;
910const grcpClient = require ( './grpc-client' ) ;
1011const {
1112 PREFIX_NAME ,
@@ -37,6 +38,7 @@ const btcdSettingsDir = path.join(isDev ? 'data' : userDataPath, 'btcd');
3738const lndArgs = process . argv . filter ( a =>
3839 / ( ^ - - b i t c o i n ) | ( ^ - - b t c d ) | ( ^ - - n e u t r i n o ) / . test ( a )
3940) ;
41+ let lndIP = parseCliArg ( 'lndip' ) ;
4042
4143// Keep a global reference of the window object, if you don't, the window will
4244// be closed automatically when the JavaScript object is garbage collected.
@@ -125,12 +127,21 @@ function createWindow() {
125127 grcpClient . init ( {
126128 ipcMain,
127129 lndSettingsDir,
130+ lndIP,
128131 lndPort : LND_PORT ,
129132 network : isDev ? 'simnet' : NETWORK ,
130133 } ) ;
131134}
132135
133136ipcMain . on ( 'lnd-restart-process' , async event => {
137+ if ( lndIP ) {
138+ event . sender . send (
139+ 'lnd-restart-error' ,
140+ 'Unable to reset password of remote lnd node.'
141+ ) ;
142+ return ;
143+ }
144+
134145 lndProcess && lndProcess . kill ( 'SIGINT' ) ;
135146 let restartError ;
136147 try {
@@ -199,7 +210,7 @@ app.on('ready', () => {
199210 initAutoUpdate ( ) ;
200211 createWindow ( ) ;
201212 initApplicationMenu ( ) ;
202- startLnd ( ) ;
213+ if ( ! lndIP ) startLnd ( ) ;
203214} ) ;
204215
205216// Quit when all windows are closed.
0 commit comments