Commit eab8f735 authored by obscuren's avatar obscuren

Event fixes for miner

parent 576df064
...@@ -126,11 +126,9 @@ out: ...@@ -126,11 +126,9 @@ out:
case event := <-events.Chan(): case event := <-events.Chan():
switch ev := event.(type) { switch ev := event.(type) {
case core.ChainHeadEvent: case core.ChainHeadEvent:
if self.current.block != ev.Block {
self.commitNewWork()
}
case core.NewMinedBlockEvent:
self.commitNewWork() self.commitNewWork()
case core.NewMinedBlockEvent:
//self.commitNewWork()
case core.ChainSideEvent: case core.ChainSideEvent:
self.uncleMu.Lock() self.uncleMu.Lock()
self.possibleUncles[ev.Block.Hash()] = ev.Block self.possibleUncles[ev.Block.Hash()] = ev.Block
...@@ -261,7 +259,7 @@ gasLimit: ...@@ -261,7 +259,7 @@ gasLimit:
uncles = append(uncles, uncle.Header()) uncles = append(uncles, uncle.Header())
} }
} }
minerlogger.Infof("commit new work with %d txs & %d uncles\n", tcount, len(uncles)) minerlogger.Infof("commit new work on block %v with %d txs & %d uncles\n", self.current.block.Number(), tcount, len(uncles))
for _, hash := range badUncles { for _, hash := range badUncles {
delete(self.possibleUncles, hash) delete(self.possibleUncles, hash)
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment