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