Browse Source

Merge pull request #429 from Empact/enhance/onboarding

Don't run onboarding if LND is already running locally
renovate/lint-staged-8.x
Ben Woosley 6 years ago
committed by GitHub
parent
commit
ee4157b49b
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 40
      app/main.dev.js

40
app/main.dev.js

@ -274,8 +274,25 @@ app.on('ready', async () => {
sendGrpcDisconnected()
// Let the application know onboarding has started.
sendStartOnboarding()
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')
}
})
startLnd(options.alias, options.autopilot)
} else {
console.log('USING CUSTOM LND')
startGrpc()

Loading…
Cancel
Save