This commit is contained in:
hatim boufnichel 2024-04-25 19:52:08 +02:00
parent d3ccd87c6e
commit 2427c212ac
2 changed files with 7 additions and 1 deletions

View file

@ -371,6 +371,11 @@ export default class {
return res.response
}
async ListPeers() {
const res = await this.lightning.listPeers({ latestError: true }, DeadLineMetadata())
return res.response
}
async OpenChannel(destination: string, closeAddress: string, fundingAmount: number, pushSats: number) {
const abortController = new AbortController()
const req = OpenChannelReq(destination, closeAddress, fundingAmount, pushSats)

View file

@ -15,12 +15,13 @@ export const setupNetwork = async () => {
throw new Error("not synced to chain")
}
if (!info.syncedToGraph) {
await lnd.ConnectPeer({})
//await lnd.ConnectPeer({})
throw new Error("not synced to graph")
}
return
} catch (e) {
console.log("waiting for lnd to be ready", e)
console.log(await lnd.ListPeers())
await new Promise(resolve => setTimeout(resolve, 1000))
}
}