aboutsummaryrefslogtreecommitdiffstats
path: root/miner
diff options
context:
space:
mode:
Diffstat (limited to 'miner')
-rw-r--r--miner/worker.go10
1 files changed, 10 insertions, 0 deletions
diff --git a/miner/worker.go b/miner/worker.go
index 012353fa1..1388b22b0 100644
--- a/miner/worker.go
+++ b/miner/worker.go
@@ -11,11 +11,14 @@ import (
"github.com/ethereum/go-ethereum/core/types"
"github.com/ethereum/go-ethereum/ethutil"
"github.com/ethereum/go-ethereum/event"
+ "github.com/ethereum/go-ethereum/logger"
"github.com/ethereum/go-ethereum/pow"
"github.com/ethereum/go-ethereum/state"
"gopkg.in/fatih/set.v0"
)
+var jsonlogger = logger.NewJsonLogger()
+
type environment struct {
totalUsedGas *big.Int
state *state.StateDB
@@ -152,6 +155,13 @@ func (self *worker) wait() {
self.current.block.Header().MixDigest = work.MixDigest
self.current.block.Header().SeedHash = work.SeedHash
+ jsonlogger.LogJson(&logger.EthMinerNewBlock{
+ BlockHash: ethutil.Bytes2Hex(block.Hash()),
+ BlockNumber: block.Number(),
+ ChainHeadHash: ethutil.Bytes2Hex(block.ParentHeaderHash),
+ BlockPrevHash: ethutil.Bytes2Hex(block.ParentHeaderHash),
+ })
+
if err := self.chain.InsertChain(types.Blocks{self.current.block}); err == nil {
self.mux.Post(core.NewMinedBlockEvent{self.current.block})
fmt.Println("GOOD BLOCK", self.current.block)