Compare commits

..

No commits in common. "aba212f6ec0f353f74c75da326cefa7554b2819c" and "1d3ab23ec466cc995f9bcb7194b790cfcf9eac10" have entirely different histories.

3 changed files with 11 additions and 18 deletions

View File

@ -21,24 +21,19 @@ getWalletInfo({ lnd }, (err, result) => {
export async function estimateRouteFee ({ lnd, destination, tokens, mtokens, request, timeout }) { export async function estimateRouteFee ({ lnd, destination, tokens, mtokens, request, timeout }) {
return await new Promise((resolve, reject) => { return await new Promise((resolve, reject) => {
const params = {}
if (request) {
params.payment_request = request
} else {
params.dest = Buffer.from(destination, 'hex')
params.amt_sat = tokens ? toPositiveNumber(tokens) : toPositiveNumber(BigInt(mtokens) / BigInt(1e3))
}
lnd.router.estimateRouteFee({ lnd.router.estimateRouteFee({
...params, dest: Buffer.from(destination, 'hex'),
amt_sat: tokens ? toPositiveNumber(tokens) : toPositiveNumber(BigInt(mtokens) / BigInt(1e3)),
payment_request: request,
timeout timeout
}, (err, res) => { }, (err, res) => {
if (err) { if (err) {
if (res?.failure_reason) { reject(err)
reject(new Error(`Unable to estimate route: ${res.failure_reason}`)) return
} else { }
reject(err)
} if (res?.failure_reason) {
reject(new Error(`Unable to estimate route: ${res.failure_reason}`))
return return
} }

View File

@ -1,4 +1,4 @@
FROM polarlightning/lnd:0.18.0-beta FROM polarlightning/lnd:0.17.5-beta
ARG LN_NODE_FOR ARG LN_NODE_FOR
ENV LN_NODE_FOR=$LN_NODE_FOR ENV LN_NODE_FOR=$LN_NODE_FOR

View File

@ -36,7 +36,7 @@ export default async function wrapInvoice (bolt11, { msats, description, descrip
throw new Error('Unable to decode invoice') throw new Error('Unable to decode invoice')
} }
console.log('invoice', inv.id, inv.mtokens, inv.expires_at, inv.cltv_delta, inv.destination) console.log('invoice', inv.mtokens, inv.expires_at, inv.cltv_delta)
// validate outgoing amount // validate outgoing amount
if (inv.mtokens) { if (inv.mtokens) {
@ -77,8 +77,6 @@ export default async function wrapInvoice (bolt11, { msats, description, descrip
case 49: case 49:
case 149: // trampoline routing case 149: // trampoline routing
case 151: // electrum trampoline routing case 151: // electrum trampoline routing
case 262:
case 263: // blinded paths
break break
default: default:
throw new Error(`Unsupported feature bit: ${f.bit}`) throw new Error(`Unsupported feature bit: ${f.bit}`)