From f28f917be196077a7e0fd7b0db09196eae6ac136 Mon Sep 17 00:00:00 2001 From: Amy Yan Date: Thu, 25 Jul 2024 12:58:13 +1000 Subject: [PATCH] wip --- src/nodes/NodeManager.ts | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/nodes/NodeManager.ts b/src/nodes/NodeManager.ts index f5c59dad5..47a860843 100644 --- a/src/nodes/NodeManager.ts +++ b/src/nodes/NodeManager.ts @@ -247,8 +247,8 @@ class NodeManager { ); const successfulConnections = connectionResults.filter( (r) => r.status === 'fulfilled', - ).length; - if (successfulConnections === 0) { + ) as Array>; + if (successfulConnections.length === 0) { const failedConnectionErrors = connectionResults .filter((r) => r.status === 'rejected') .map((v) => { @@ -261,6 +261,11 @@ class NodeManager { }, ); } + else { + // wip: We should ideally take the fastest connection and use it here for node signing. + const conn = successfulConnections[0].value; + conn.rpcClient.methods + } if (ctx.signal.aborted) return; // Attempt a findNode operation looking for ourselves