diff --git a/src/miner.rs b/src/miner.rs index 713bfa4..d4703b8 100644 --- a/src/miner.rs +++ b/src/miner.rs @@ -188,6 +188,9 @@ impl Miner { error!("To mine genesis block you need to make 'origin' an empty string in config."); } } else { + if block.index == 1 { + context.settings.origin = block.hash.to_string(); + } context.chain.add_block(block); } context.bus.post(Event::MinerStopped); diff --git a/src/simplebus.rs b/src/simplebus.rs index a8f281d..e3d052c 100644 --- a/src/simplebus.rs +++ b/src/simplebus.rs @@ -52,7 +52,7 @@ mod tests { } let bus2 = bus.clone(); thread::spawn(move || { - bus2.lock().unwrap().post(Event::BlockchainChanged); + bus2.lock().unwrap().post(Event::BlockchainChanged { index: 1 }); }); let guard = string.lock().unwrap();