Skip to content

Commit

Permalink
fix connect identifier init for noencrypt
Browse files Browse the repository at this point in the history
  • Loading branch information
sangaman committed Nov 3, 2020
1 parent d94a1b2 commit 9579322
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
5 changes: 3 additions & 2 deletions lib/connextclient/ConnextClient.ts
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,7 @@ class ConnextClient extends SwapClient {
public address?: string;
/** A map of currency symbols to token addresses. */
public tokenAddresses = new Map<string, string>();
public userIdentifier?: string;
/**
* A map of expected invoices by hash.
* This is equivalent to invoices of lnd with the difference
Expand Down Expand Up @@ -371,9 +372,9 @@ class ConnextClient extends SwapClient {
this.subscribeIncomingTransfer(),
this.subscribeDeposit(),
]);
const { userIdentifier } = config;
this.userIdentifier = config.userIdentifier;
this.emit('connectionVerified', {
newIdentifier: userIdentifier,
newIdentifier: this.userIdentifier,
});
this.setStatus(ClientStatus.ConnectionVerified);
} catch (err) {
Expand Down
5 changes: 4 additions & 1 deletion lib/swaps/Swaps.ts
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ class Swaps extends EventEmitter {
}

public init = async () => {
// update pool with lnd pubkeys
// update pool with current lnd & connext pubkeys
this.swapClientManager.getLndClientsMap().forEach(({ pubKey, chain, currency, uris }) => {
if (pubKey && chain) {
this.pool.updateLndState({
Expand All @@ -154,6 +154,9 @@ class Swaps extends EventEmitter {
});
}
});
if (this.swapClientManager.connextClient) {
this.pool.updateConnextState(this.swapClientManager.connextClient.tokenAddresses, this.swapClientManager.connextClient.userIdentifier);
}

this.swapRecovery.beginTimer();
const swapDealInstances = await this.repository.getSwapDeals();
Expand Down

0 comments on commit 9579322

Please sign in to comment.