diff --git a/src/services/lnd/lnd.ts b/src/services/lnd/lnd.ts index 8b15eff7c..e7c07472a 100644 --- a/src/services/lnd/lnd.ts +++ b/src/services/lnd/lnd.ts @@ -211,9 +211,11 @@ export default class { }) } - async NewAddress(addressType: Types.AddressType): Promise { + async NewAddress(addressType: Types.AddressType, skipHealthCheck = false): Promise { this.log("generating new address") - await this.Health() + if (!skipHealthCheck) { + await this.Health() + } let lndAddressType: AddressType switch (addressType) { case Types.AddressType.NESTED_PUBKEY_HASH: @@ -356,7 +358,6 @@ export default class { } async OpenChannel(destination: string, closeAddress: string, fundingAmount: number, pushSats: number) { - await this.Health() const abortController = new AbortController() const req = OpenChannelReq(destination, closeAddress, fundingAmount, pushSats) const stream = this.lightning.openChannel(req, { abort: abortController.signal }) diff --git a/src/tests/networkSetup.ts b/src/tests/networkSetup.ts index 1164c1095..b1032dca3 100644 --- a/src/tests/networkSetup.ts +++ b/src/tests/networkSetup.ts @@ -9,7 +9,7 @@ export const setupNetwork = async () => { const core = new Core(settings) await core.Init() const { alice, bob, carol, dave } = await initLndInstances(settings) - /*const aliceAddr = await alice.NewAddress(AddressType.WITNESS_PUBKEY_HASH) + /*const aliceAddr = await alice.NewAddress(AddressType.WITNESS_PUBKEY_HASH, true) const bobAddr = await bob.NewAddress(AddressType.WITNESS_PUBKEY_HASH) const carolAddr = await carol.NewAddress(AddressType.WITNESS_PUBKEY_HASH) const daveAddr = await dave.NewAddress(AddressType.WITNESS_PUBKEY_HASH) @@ -19,7 +19,11 @@ export const setupNetwork = async () => { await core.SendToAddress(daveAddr.address, 10) await core.Mine(6)*/ const alicePub = await alice.GetInfo() - console.log({ alicePub }) + const [pubkey, host] = alicePub.uris[0].split('@') + await alice.ConnectPeer(pubkey, host) + console.log(await alice.GetInfo()) + const aliceAddr = await alice.NewAddress(AddressType.WITNESS_PUBKEY_HASH, true) + console.log({ aliceAddr }) } const initLndInstances = async (settings: TestSettings) => {