Browse Source

Don't run onboarding if LND is already running locally

The onboarding settings are only relevant if the user wants to connect to a
remote LND or have Zap run LND. If the LND is already running locally, the user
is capable of separately configuring it.

This does not support the case of connecting to a remote LND while running LND
locally, but I can't think of a reason why someone would do such a thing. In
such a case, they could quit LND, start Zap, then re-start LND.
renovate/lint-staged-8.x
Ben Woosley 7 years ago
parent
commit
0ce5b04fe5
No known key found for this signature in database GPG Key ID: 6EE5F3785F78B345
  1. 34
      app/main.dev.js

34
app/main.dev.js

@ -274,8 +274,25 @@ app.on('ready', async () => {
sendGrpcDisconnected()
console.log('LOOKING FOR LOCAL LND')
// Check to see if an LND process is running.
lookup({ command: 'lnd' }, (err, results) => {
// There was an error checking for the LND process.
if (err) {
throw new Error(err)
}
// No LND process was found.
if (!results.length) {
// Let the application know onboarding has started.
sendStartOnboarding()
} else {
// An LND process was found, no need to start our own.
console.log('LND ALREADY RUNNING')
startGrpc()
mainWindow.webContents.send('successfullyCreatedWallet')
}
})
// Start LND
// once the onboarding has enough information, start or connect to LND.
@ -295,24 +312,7 @@ app.on('ready', async () => {
console.log('SAVED CONFIG TO:', store.path, 'AS', store.store)
if (options.connectionType === 'local') {
console.log('LOOKING FOR LOCAL LND')
// Check to see if an LND process is running.
lookup({ command: 'lnd' }, (err, results) => {
// There was an error checking for the LND process.
if (err) {
throw new Error(err)
}
// No LND process was found.
if (!results.length) {
startLnd(options.alias, options.autopilot)
} else {
// An LND process was found, no need to start our own.
console.log('LND ALREADY RUNNING')
startGrpc()
mainWindow.webContents.send('successfullyCreatedWallet')
}
})
} else {
console.log('USING CUSTOM LND')
startGrpc()

Loading…
Cancel
Save