Browse Source

fix(decodeInvoice): send pubkey back. can use to query routes and offer auto connect to peer and/or channel if no route

renovate/lint-staged-8.x
Jack Mallers 7 years ago
parent
commit
9cc3165ec9
  1. 4
      app/lnd/utils/index.js

4
app/lnd/utils/index.js

@ -19,6 +19,9 @@ export function decodeInvoice(payreq) {
+ bufferHexRotated.substr(0, bufferHexRotated.length - 1)
const buffer = Buffer.from(bufferHex, 'hex')
var pubkeyBuffer = buffer.slice(0, 33);
var pubkey = pubkeyBuffer.toString('hex');
const paymentHashBuffer = buffer.slice(33, 65)
const paymentHashHex = paymentHashBuffer.toString('hex')
@ -28,6 +31,7 @@ export function decodeInvoice(payreq) {
return {
payreq,
pubkey,
amount,
r_hash: paymentHashHex
}

Loading…
Cancel
Save