don't bail if node is unannounced
This commit is contained in:
parent
ac1c64e402
commit
6633b9f894
|
@ -445,12 +445,18 @@ export async function createWithdrawal (parent, { invoice, maxFee }, { me, model
|
|||
let decoded, node
|
||||
try {
|
||||
decoded = await decodePaymentRequest({ lnd, request: invoice })
|
||||
node = await getNode({ lnd, public_key: decoded.destination, is_omitting_channels: true })
|
||||
} catch (error) {
|
||||
console.log(error)
|
||||
throw new GraphQLError('could not decode invoice', { extensions: { code: 'BAD_INPUT' } })
|
||||
}
|
||||
|
||||
try {
|
||||
node = await getNode({ lnd, public_key: decoded.destination, is_omitting_channels: true })
|
||||
} catch (error) {
|
||||
// likely not found if it's an unannounced channel, e.g. phoenix
|
||||
console.log(error)
|
||||
}
|
||||
|
||||
if (node) {
|
||||
for (const { socket } of node.sockets) {
|
||||
const ip = socket.split(':')[0]
|
||||
|
|
Loading…
Reference in New Issue