From c95bdb6752657aaaf3032d19e847532acfded096 Mon Sep 17 00:00:00 2001 From: Luke Parker <lukeparker5132@gmail.com> Date: Tue, 9 May 2023 23:51:05 -0400 Subject: [PATCH] Properly get genesis for a Processor message --- coordinator/src/main.rs | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/coordinator/src/main.rs b/coordinator/src/main.rs index 00d7bdca..f1e3f9f6 100644 --- a/coordinator/src/main.rs +++ b/coordinator/src/main.rs @@ -370,8 +370,18 @@ pub async fn handle_processors<D: Db, Pro: Processors, P: P2p>( loop { let msg = processors.recv().await; - // TODO: Get genesis hash by msg.network - let genesis = [0; 32]; + // TODO2: This is slow, and only works as long as a network only has a single Tributary + // (which means there's a lack of multisig rotation) + let genesis = { + let mut genesis = None; + for tributary in tributaries.read().await.values() { + if tributary.spec.set().network == msg.network { + genesis = Some(tributary.spec.genesis()); + break; + } + } + genesis.unwrap() + }; let tx = match msg.msg { ProcessorMessage::KeyGen(msg) => match msg {