up
This commit is contained in:
parent
d3ccd87c6e
commit
2427c212ac
2 changed files with 7 additions and 1 deletions
|
|
@ -371,6 +371,11 @@ export default class {
|
||||||
return res.response
|
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) {
|
async OpenChannel(destination: string, closeAddress: string, fundingAmount: number, pushSats: number) {
|
||||||
const abortController = new AbortController()
|
const abortController = new AbortController()
|
||||||
const req = OpenChannelReq(destination, closeAddress, fundingAmount, pushSats)
|
const req = OpenChannelReq(destination, closeAddress, fundingAmount, pushSats)
|
||||||
|
|
|
||||||
|
|
@ -15,12 +15,13 @@ export const setupNetwork = async () => {
|
||||||
throw new Error("not synced to chain")
|
throw new Error("not synced to chain")
|
||||||
}
|
}
|
||||||
if (!info.syncedToGraph) {
|
if (!info.syncedToGraph) {
|
||||||
await lnd.ConnectPeer({})
|
//await lnd.ConnectPeer({})
|
||||||
throw new Error("not synced to graph")
|
throw new Error("not synced to graph")
|
||||||
}
|
}
|
||||||
return
|
return
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
console.log("waiting for lnd to be ready", e)
|
console.log("waiting for lnd to be ready", e)
|
||||||
|
console.log(await lnd.ListPeers())
|
||||||
await new Promise(resolve => setTimeout(resolve, 1000))
|
await new Promise(resolve => setTimeout(resolve, 1000))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue