mirror of
https://github.com/serai-dex/serai.git
synced 2025-02-02 03:06:31 +00:00
Properly get genesis for a Processor message
This commit is contained in:
parent
88f0e89350
commit
c95bdb6752
1 changed files with 12 additions and 2 deletions
|
@ -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 {
|
||||
|
|
Loading…
Reference in a new issue