Skip to content

Commit aefdce8

Browse files
author
Karl Ranna
committed
feat(lnd): change gRPC client options
1 parent 962daa4 commit aefdce8

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

Diff for: lib/lndclient/LndClient.ts

+6-2
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,10 @@ interface LndClient {
3636

3737
const MAXFEE = 0.03;
3838
const BASE_MAX_CLIENT_WAIT_TIME = 6000;
39+
const GRPC_CLIENT_OPTIONS = {
40+
'grpc.ssl_target_name_override': 'localhost',
41+
'grpc.default_authority': 'localhost',
42+
};
3943

4044
/** A class representing a client to interact with lnd. */
4145
class LndClient extends SwapClient {
@@ -207,7 +211,7 @@ class LndClient extends SwapClient {
207211
/** Lnd specific procedure to mark the client as locked. */
208212
private lock = () => {
209213
if (!this.walletUnlocker) {
210-
this.walletUnlocker = new WalletUnlockerClient(this.uri, this.credentials);
214+
this.walletUnlocker = new WalletUnlockerClient(this.uri, this.credentials, GRPC_CLIENT_OPTIONS);
211215
}
212216
if (this.lightning) {
213217
this.lightning.close();
@@ -466,7 +470,7 @@ class LndClient extends SwapClient {
466470
}
467471

468472
this.logger.info(`trying to verify connection to lnd at ${this.uri}`);
469-
this.lightning = new LightningClient(this.uri, this.credentials);
473+
this.lightning = new LightningClient(this.uri, this.credentials, GRPC_CLIENT_OPTIONS);
470474

471475
try {
472476
await this.waitForClientReady(this.lightning);

0 commit comments

Comments
 (0)