diff options
author | aaronbuchwald <[email protected]> | 2020-09-17 09:36:44 -0400 |
---|---|---|
committer | GitHub <[email protected]> | 2020-09-17 09:36:44 -0400 |
commit | 42ee77a946d062a4c8e1fabc394ac016ae30e68e (patch) | |
tree | 85da01f5b75788e257d3c355917a4b3a8ad8603b /coreth.go | |
parent | 92fdc0a4b6208387424029182a131b25a2f92dac (diff) | |
parent | 6b4efa7ff5537a7cdb1d73b18dd75f56bdadc032 (diff) |
Merge pull request #33 from ava-labs/fix-nil-pointer
Fix potential nil pointer dereference
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()) |