From 0d4d5b9555fd818ab4b85aead994ef11e8d65582 Mon Sep 17 00:00:00 2001 From: Brian Schroeder Date: Fri, 24 Mar 2017 14:35:39 -0400 Subject: [PATCH] Remove posting of ChainEvent during minting ChainEvent should instead be posted when we extend the chain. --- raft/minter.go | 15 +-------------- 1 file changed, 1 insertion(+), 14 deletions(-) diff --git a/raft/minter.go b/raft/minter.go index 4947c17c8..c24d88924 100644 --- a/raft/minter.go +++ b/raft/minter.go @@ -272,19 +272,6 @@ func (minter *minter) firePendingBlockEvents(logs vm.Logs) { }() } -func (minter *minter) fireMintedBlockEvents(block *types.Block, logs vm.Logs) { - minter.mux.Post(core.NewMinedBlockEvent{Block: block}) - minter.mux.Post(core.ChainEvent{Block: block, Hash: block.Hash(), Logs: logs}) - - // NOTE: we're currently not doing this because the block is not in the - // chain yet, and it seems like that's a prerequisite for this? - // - // TODO: do we need to do this in handleLogCommands in the case where we - // minted the block? - // - // minter.mux.Post(work.publicState.Logs()) -} - func (minter *minter) mintNewBlock() { minter.mu.Lock() defer minter.mu.Unlock() @@ -356,7 +343,7 @@ func (minter *minter) mintNewBlock() { minter.speculativeChain.extend(block) - minter.fireMintedBlockEvents(block, logs) + minter.mux.Post(core.NewMinedBlockEvent{Block: block}) elapsed := time.Since(time.Unix(0, header.Time.Int64())) glog.V(logger.Info).Infof("🔨 Mined block (#%v / %x) in %v", block.Number(), block.Hash().Bytes()[:4], elapsed)