Skip to content

Commit

Permalink
feat(lnd): change gRPC client options
Browse files Browse the repository at this point in the history
  • Loading branch information
Karl Ranna committed Oct 28, 2020
1 parent 962daa4 commit aefdce8
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 @@ -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();
Expand Down Expand Up @@ -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);
Expand Down

0 comments on commit aefdce8

Please sign in to comment.