Additional check

This commit is contained in:
morrigan
2020-02-08 12:11:16 +01:00
parent 36e3462a82
commit a5c45bfc53
2 changed files with 5 additions and 3 deletions

View File

@ -181,8 +181,8 @@ export class Noise implements INoiseConnection {
await handshake.exchange();
await handshake.finish();
if (this.useNoisePipes && remotePeer) {
KeyCache.store(remotePeer, handshake.getRemoteStaticKey());
if (this.useNoisePipes && handshake.remotePeer) {
KeyCache.store(handshake.remotePeer, handshake.getRemoteStaticKey());
}
} catch (e) {
throw new Error(`Error occurred during XX handshake: ${e.message}`);