This commit is contained in:
hatim boufnichel 2024-04-25 19:39:40 +02:00
parent 4cf983342d
commit a87cb4ab2c

View file

@ -8,7 +8,7 @@ export const setupNetwork = async () => {
await core.InitAddress() await core.InitAddress()
await core.Mine(1) await core.Mine(1)
const lnd = new LND(settings.lndSettings, () => { }, () => { }, () => { }, () => { }) const lnd = new LND(settings.lndSettings, () => { }, () => { }, () => { }, () => { })
for (let i = 0; i < 10; i++) { for (let i = 0; i < 30; i++) {
try { try {
const info = await lnd.GetInfo() const info = await lnd.GetInfo()
if (!info.syncedToChain) { if (!info.syncedToChain) {
@ -19,6 +19,9 @@ export const setupNetwork = async () => {
} }
return return
} catch (e) { } catch (e) {
if (i % 5 === 0) {
await core.Mine(1)
}
console.log("waiting for lnd to be ready") console.log("waiting for lnd to be ready")
await new Promise(resolve => setTimeout(resolve, 1000)) await new Promise(resolve => setTimeout(resolve, 1000))
} }