aboutsummaryrefslogtreecommitdiffstats
path: root/miner/miner.go
diff options
context:
space:
mode:
Diffstat (limited to 'miner/miner.go')
-rw-r--r--miner/miner.go7
1 files changed, 5 insertions, 2 deletions
diff --git a/miner/miner.go b/miner/miner.go
index b25e25357..795385424 100644
--- a/miner/miner.go
+++ b/miner/miner.go
@@ -29,6 +29,7 @@ import (
"github.com/ethereum/go-ethereum"
"github.com/ethereum/go-ethereum/ethutil"
+ "github.com/ethereum/go-ethereum/state"
"github.com/ethereum/go-ethereum/chain"
"github.com/ethereum/go-ethereum/chain/types"
@@ -218,8 +219,10 @@ func (self *Miner) mine() {
if err != nil {
minerlogger.Infoln(err)
} else {
- chainMan.InsertChain(lchain)
- //self.eth.EventMux().Post(chain.NewBlockEvent{block})
+ chainMan.InsertChain(lchain, func(block *types.Block, _ state.Messages) {
+ self.eth.EventMux().Post(chain.NewBlockEvent{block})
+ })
+
self.eth.Broadcast(wire.MsgBlockTy, []interface{}{block.Value().Val})
minerlogger.Infof("🔨 Mined block %x\n", block.Hash())