From aefdce84e2c6cae35bf243f21a5224427fe2bfcc Mon Sep 17 00:00:00 2001 From: Karl Ranna Date: Mon, 26 Oct 2020 20:21:52 +0000 Subject: [PATCH] feat(lnd): change gRPC client options --- lib/lndclient/LndClient.ts | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/lib/lndclient/LndClient.ts b/lib/lndclient/LndClient.ts index 9c55d7bd2..ff2f44927 100644 --- a/lib/lndclient/LndClient.ts +++ b/lib/lndclient/LndClient.ts @@ -36,6 +36,10 @@ interface LndClient { const MAXFEE = 0.03; const BASE_MAX_CLIENT_WAIT_TIME = 6000; +const GRPC_CLIENT_OPTIONS = { + 'grpc.ssl_target_name_override': 'localhost', + 'grpc.default_authority': 'localhost', +}; /** A class representing a client to interact with lnd. */ class LndClient extends SwapClient { @@ -207,7 +211,7 @@ class LndClient extends SwapClient { /** Lnd specific procedure to mark the client as locked. */ private lock = () => { if (!this.walletUnlocker) { - this.walletUnlocker = new WalletUnlockerClient(this.uri, this.credentials); + this.walletUnlocker = new WalletUnlockerClient(this.uri, this.credentials, GRPC_CLIENT_OPTIONS); } if (this.lightning) { this.lightning.close(); @@ -466,7 +470,7 @@ class LndClient extends SwapClient { } this.logger.info(`trying to verify connection to lnd at ${this.uri}`); - this.lightning = new LightningClient(this.uri, this.credentials); + this.lightning = new LightningClient(this.uri, this.credentials, GRPC_CLIENT_OPTIONS); try { await this.waitForClientReady(this.lightning);