diff options
author | Determinant <[email protected]> | 2020-09-17 03:08:39 -0400 |
---|---|---|
committer | Determinant <[email protected]> | 2020-09-17 03:08:39 -0400 |
commit | aedd4b46cdc0a48c1b06a3e920bf57f8c28d401d (patch) | |
tree | 2614d9060c915cb368828e76c4a2d9a2bc20c61f /coreth.go | |
parent | 8a12d92f6460bc6caa1217cbfadb7799670c3b1c (diff) |
fix the block completion race
Diffstat (limited to 'coreth.go')
-rw-r--r-- | coreth.go | 5 |
1 files changed, 5 insertions, 0 deletions
@@ -17,6 +17,7 @@ import ( "github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/crypto" "github.com/ethereum/go-ethereum/ethdb" + "github.com/ethereum/go-ethereum/event" "github.com/ethereum/go-ethereum/trie" //"github.com/ethereum/go-ethereum/event" "github.com/ethereum/go-ethereum/log" @@ -85,6 +86,10 @@ func (self *ETHChain) GenBlock() { self.backend.Miner().GenBlock() } +func (self *ETHChain) SubscribeNewMinedBlockEvent() *event.TypeMuxSubscription { + return self.backend.Miner().GetWorkerMux().Subscribe(core.NewMinedBlockEvent{}) +} + func (self *ETHChain) VerifyBlock(block *types.Block) bool { txnHash := types.DeriveSha(block.Transactions(), new(trie.Trie)) uncleHash := types.CalcUncleHash(block.Uncles()) |