From 55f4117652b04532e1fb1c21853f4775536ce491 Mon Sep 17 00:00:00 2001 From: Luke Childs Date: Thu, 12 Nov 2020 15:18:47 +0700 Subject: [PATCH 1/2] Allow opening channels with unconfirmed UTXOs --- services/lnd.js | 1 + 1 file changed, 1 insertion(+) diff --git a/services/lnd.js b/services/lnd.js index 1cac962..99122cb 100644 --- a/services/lnd.js +++ b/services/lnd.js @@ -339,6 +339,7 @@ function openChannel(pubKey, amt, satPerByte) { const rpcPayload = { node_pubkey_string: pubKey, local_funding_amount: amt, + spend_unconfirmed: true, }; if (satPerByte) { From b7fff351aeb79030f066643623c4c4b78f77f69c Mon Sep 17 00:00:00 2001 From: Luke Childs Date: Thu, 12 Nov 2020 17:03:54 +0700 Subject: [PATCH 2/2] Add fee TODO --- logic/lightning.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/logic/lightning.js b/logic/lightning.js index b9128ed..b0483c5 100644 --- a/logic/lightning.js +++ b/logic/lightning.js @@ -104,6 +104,9 @@ function decodePaymentRequest(paymentRequest) { // generate our own unused address and then feed that into the existing call. Then we add an extra 10 sats per // feerateSatPerByte. This is because the actual cost is slightly more than the default one output estimate. async function estimateChannelOpenFee(amt, confTarget, sweep) { + + // TODO: Make this work with spend_unconfirmed + const address = (await generateAddress()).address; const baseFeeEstimate = await estimateFee(address, amt, confTarget, sweep);