up
This commit is contained in:
parent
0ccc08371f
commit
13f98fd459
1 changed files with 16 additions and 1 deletions
|
|
@ -80,7 +80,22 @@ export default class {
|
|||
this.SubscribeInvoicePaid()
|
||||
this.SubscribeNewBlock()
|
||||
this.SubscribeHtlcEvents()
|
||||
const now = Date.now()
|
||||
return new Promise<void>((res, rej) => {
|
||||
const interval = setInterval(async () => {
|
||||
try {
|
||||
await this.Health()
|
||||
clearInterval(interval)
|
||||
this.ready = true
|
||||
res()
|
||||
} catch (err) {
|
||||
this.log("LND is not ready yet, will try again in 1 second")
|
||||
if (Date.now() - now > 1000 * 60) {
|
||||
rej(new Error("LND not ready after 1 minute"))
|
||||
}
|
||||
}
|
||||
}, 1000)
|
||||
})
|
||||
}
|
||||
|
||||
async GetInfo(): Promise<NodeInfo> {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue