Skip to content
Permalink
Browse files

fix(lndconnect): support old style lndconnect links

Convert old style lndconnect links to the new format before storing as
part of a wallet config.

fix #1997
  • Loading branch information...
mrfelton committed Apr 10, 2019
1 parent 4b706d9 commit b4c5d04d38fa6ea7d49813e7f460ae480efc4522
Showing with 18 additions and 6 deletions.
  1. +1 −1 package.json
  2. +13 −1 renderer/components/Onboarding/Steps/ConnectionConfirm.js
  3. +4 −4 yarn.lock
@@ -344,7 +344,7 @@
"javascript-state-machine": "3.1.0",
"jstimezonedetect": "1.0.6",
"lnd-grpc": "0.1.21",
"lndconnect": "0.2.3",
"lndconnect": "0.2.4",
"lodash.debounce": "4.0.8",
"lodash.get": "4.4.2",
"lodash.matches": "4.6.0",
@@ -61,10 +61,22 @@ class ConnectionConfirm extends React.Component {

// If its already an lndconnect uri, use it as is.
if (connectionString.startsWith('lndconnect:')) {
// In order to support legacy style lndconnect links we first pass the connection string through
// lndconnect.decode (which supports legacy style links where the host is provided as a querystring). Then encode
// the result. This ensures that we always store the link the current lndconnect format (with the host part in the
// origin position).
//
// eg. legacy lndconnect format:
// lndconnect:?cert=~/.lnd/tls.cert&macaroon=~/.lnd/admin.macaroon&host=example.com:10009
//
// eg. current lndconnect format:
// lndconnect://example.com:10009?cert=~/.lnd/tls.cert&macaroon=~/.lnd/admin.macaroon
const lndconnectUri = encode(decode(connectionString))

return startLnd({
type: 'custom',
decoder: 'lnd.lndconnect.v1',
lndconnectUri: connectionString,
lndconnectUri,
})
}

@@ -10949,10 +10949,10 @@ lnd-grpc@0.1.21:
debug "^4.1.1"
semver "^5.7.0"

lndconnect@0.2.3:
version "0.2.3"
resolved "https://registry.yarnpkg.com/lndconnect/-/lndconnect-0.2.3.tgz#73cdaa0533aebccce72a64830867b047f4a9523c"
integrity sha512-hpct0HRTfAxbmUUfYQoHTiIsIbARs2NxGP19iFfxqzU/DoDuyX+tpnAOxfSA1sD0TGITXl3aNXYJD9Mp1xIqvw==
lndconnect@0.2.4:
version "0.2.4"
resolved "https://registry.yarnpkg.com/lndconnect/-/lndconnect-0.2.4.tgz#26be0bbc5c13f730ac377bb768708356fa72c4d2"
integrity sha512-TrDSPJysUhfZ+Zjh3K8Prs3ARhUO+jdaxFdRNpZQQowyU3fty0L5fgU1flBb6WseICmQZoWel9ORBLrkFwzKwQ==
dependencies:
base64url "^3.0.1"
decode-uri-component "^0.2.0"

0 comments on commit b4c5d04

Please sign in to comment.
You can’t perform that action at this time.