commit
502c418c3d
2 changed files with 14 additions and 2 deletions
|
|
@ -160,12 +160,24 @@ const server = program => {
|
|||
const startServer = async () => {
|
||||
try {
|
||||
LightningServices.setDefaults(program)
|
||||
if (!LightningServices.isInitialized()) {
|
||||
await LightningServices.init()
|
||||
}
|
||||
|
||||
// init lnd module =================
|
||||
const lnd = require('../services/lnd/lnd')(
|
||||
LightningServices.services.lightning
|
||||
)
|
||||
await new Promise((resolve, reject) => {
|
||||
LightningServices.services.lightning.getInfo({}, (err, res) => {
|
||||
if (err && err.code !== 12) {
|
||||
reject(err)
|
||||
} else {
|
||||
resolve()
|
||||
}
|
||||
})
|
||||
})
|
||||
|
||||
const auth = require('../services/auth/auth')
|
||||
|
||||
app.use(compression())
|
||||
|
|
|
|||
|
|
@ -107,7 +107,7 @@ class LNDErrorManager {
|
|||
this._healthListeners.length = 0
|
||||
this._isCheckingHealth = false
|
||||
}
|
||||
const deadline = Date.now() + 4000
|
||||
const deadline = Date.now() + 10000
|
||||
lightning.getInfo({},{deadline}, callback)
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue