Skip to content

Commit

Permalink
Merge pull request #1966 from ExchangeUnion/feat/lnd-grpc-client-options
Browse files Browse the repository at this point in the history
feat(lnd): change gRPC client options
  • Loading branch information
Karl Ranna authored Nov 9, 2020
2 parents d537206 + aefdce8 commit 3fb5f18
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions lib/lndclient/LndClient.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down Expand Up @@ -199,7 +203,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();
Expand Down Expand Up @@ -458,7 +462,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);
Expand Down

0 comments on commit 3fb5f18

Please sign in to comment.