Skip to content

Commit

Permalink
up
Browse files Browse the repository at this point in the history
  • Loading branch information
boufni95 committed Apr 25, 2024
1 parent 64717eb commit 60bb0e2
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
5 changes: 5 additions & 0 deletions src/services/lnd/lnd.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
3 changes: 2 additions & 1 deletion src/tests/networkSetup.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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))
}
}
Expand Down

0 comments on commit 60bb0e2

Please sign in to comment.