mirror of
https://github.com/fluencelabs/js-libp2p-noise
synced 2025-04-25 08:22:35 +00:00
Fix tsc
This commit is contained in:
parent
082b0c560a
commit
ceb31929a2
@ -7,8 +7,7 @@ import PeerId from "peer-id";
|
||||
class Keycache {
|
||||
private storage = new Map<bytes, bytes32>();
|
||||
|
||||
public store(peerId?: PeerId, key: bytes32): void {
|
||||
if(!peerId) return;
|
||||
public store(peerId: PeerId, key: bytes32): void {
|
||||
this.storage.set(peerId.id, key);
|
||||
}
|
||||
|
||||
|
@ -181,7 +181,7 @@ export class Noise implements INoiseConnection {
|
||||
await handshake.exchange();
|
||||
await handshake.finish();
|
||||
|
||||
if (this.useNoisePipes) {
|
||||
if (this.useNoisePipes && remotePeer) {
|
||||
KeyCache.store(remotePeer, handshake.getRemoteStaticKey());
|
||||
}
|
||||
} catch (e) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user