From a03ae542b10354798466b98eec2021b62b5edd0d Mon Sep 17 00:00:00 2001 From: Derrick Hammer Date: Wed, 29 Mar 2023 17:07:25 -0400 Subject: [PATCH] *Add rpc ready call to consensusHandler and executionHandler to ensure we have a relay before continuing --- src/index.ts | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/index.ts b/src/index.ts index 49b8ffc..509adbd 100644 --- a/src/index.ts +++ b/src/index.ts @@ -65,6 +65,11 @@ async function handleRpcMethod(aq: ActiveQuery) { } async function consensusHandler(method: string, data: any) { + // @ts-ignore + await ( + await rpc.ready + )(); + while (true) { let query = await rpc.simpleQuery({ query: { @@ -87,6 +92,10 @@ async function consensusHandler(method: string, data: any) { } async function executionHandler(data: Map) { + // @ts-ignore + await ( + await rpc.ready + )(); while (true) { let query = await rpc.simpleQuery({ query: {