diff options
author | obscuren <geffobscura@gmail.com> | 2015-06-15 17:33:08 +0800 |
---|---|---|
committer | obscuren <geffobscura@gmail.com> | 2015-06-15 17:33:08 +0800 |
commit | 6d817e16c1c17f7cad4a34fa91457e21f63f2de4 (patch) | |
tree | fad58ed95ee70bcee2766347148eb25b27382122 /miner/worker.go | |
parent | 6f5c6150b7060b6b2ee68ac95b30f46c5c2c7f90 (diff) | |
download | dexon-6d817e16c1c17f7cad4a34fa91457e21f63f2de4.tar dexon-6d817e16c1c17f7cad4a34fa91457e21f63f2de4.tar.gz dexon-6d817e16c1c17f7cad4a34fa91457e21f63f2de4.tar.bz2 dexon-6d817e16c1c17f7cad4a34fa91457e21f63f2de4.tar.lz dexon-6d817e16c1c17f7cad4a34fa91457e21f63f2de4.tar.xz dexon-6d817e16c1c17f7cad4a34fa91457e21f63f2de4.tar.zst dexon-6d817e16c1c17f7cad4a34fa91457e21f63f2de4.zip |
core, miner: tx pool drops txs below ask price
Diffstat (limited to 'miner/worker.go')
-rw-r--r-- | miner/worker.go | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/miner/worker.go b/miner/worker.go index bd4bc0e3c..d339507ca 100644 --- a/miner/worker.go +++ b/miner/worker.go @@ -6,6 +6,7 @@ import ( "sort" "sync" "sync/atomic" + "time" "github.com/ethereum/go-ethereum/accounts" "github.com/ethereum/go-ethereum/common" @@ -374,6 +375,8 @@ func (self *worker) commitNewWork() { self.currentMu.Lock() defer self.currentMu.Unlock() + tstart := time.Now() + previous := self.current self.makeCurrent() current := self.current @@ -409,7 +412,7 @@ func (self *worker) commitNewWork() { // We only care about logging if we're actually mining if atomic.LoadInt32(&self.mining) == 1 { - glog.V(logger.Info).Infof("commit new work on block %v with %d txs & %d uncles\n", current.block.Number(), current.tcount, len(uncles)) + glog.V(logger.Info).Infof("commit new work on block %v with %d txs & %d uncles. Took %v\n", current.block.Number(), current.tcount, len(uncles), time.Since(tstart)) self.logLocalMinedBlocks(previous) } @@ -437,7 +440,6 @@ func (self *worker) commitUncle(uncle *types.Header) error { // Error not unique return core.UncleError("Uncle not unique") } - self.current.uncles.Add(uncle.Hash()) if !self.current.ancestors.Has(uncle.ParentHash) { return core.UncleError(fmt.Sprintf("Uncle's parent unknown (%x)", uncle.ParentHash[0:4])) @@ -446,6 +448,7 @@ func (self *worker) commitUncle(uncle *types.Header) error { if self.current.family.Has(uncle.Hash()) { return core.UncleError(fmt.Sprintf("Uncle already in family (%x)", uncle.Hash())) } + self.current.uncles.Add(uncle.Hash()) return nil } |