fix: if a peer completed the handshake, but our node is stopped, end the peer and abort

This commit is contained in:
Derrick Hammer 2023-09-02 04:50:52 -04:00
parent b3e690b0d4
commit 6cc0bd6500
Signed by: pcfreak30
GPG Key ID: C997C339BE476FF2
1 changed files with 4 additions and 0 deletions

View File

@ -11,6 +11,10 @@ export default async function (
message: SignedMessage, message: SignedMessage,
verifyId: boolean, verifyId: boolean,
) { ) {
if (!node.started) {
peer.end();
return;
}
const p2p = node.services.p2p; const p2p = node.services.p2p;
const challenge = data.unpackBinary(); const challenge = data.unpackBinary();