From f4f852cce002319cddb024262f589a34b344f456 Mon Sep 17 00:00:00 2001 From: Anson Date: Mon, 4 Sep 2023 17:03:01 +0100 Subject: [PATCH] [V2/V3] feat: add handshake body checks on 'successful' handhshakes (#207) * feat: add handshake body checks on 'successful' handhshakes * fix: remove throwing error --- packages/core/src/lib/lit-core.ts | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/packages/core/src/lib/lit-core.ts b/packages/core/src/lib/lit-core.ts index 41b6e1a44b..306b751339 100644 --- a/packages/core/src/lib/lit-core.ts +++ b/packages/core/src/lib/lit-core.ts @@ -149,6 +149,16 @@ export class LitCore { networkPubKeySet: resp.networkPublicKeySet, }; + // -- validate returned keys + if ( + keys.serverPubKey === 'ERR' || + keys.subnetPubKey === 'ERR' || + keys.networkPubKey === 'ERR' || + keys.networkPubKeySet === 'ERR' + ) { + log('Error connecting to node. Detected "ERR" in keys', url, keys); + } + this.serverKeys[url] = keys; }) .catch((e: any) => {