diff options
author | Jeffrey Wilcke <jeffrey@ethereum.org> | 2015-06-16 00:09:44 +0800 |
---|---|---|
committer | Jeffrey Wilcke <jeffrey@ethereum.org> | 2015-06-16 00:09:44 +0800 |
commit | cc0b451119478ba4a005ec8840573252636f45dc (patch) | |
tree | f1e9882b7dea20eab9cd30850224a07bb312f067 /miner | |
parent | f2a2164184a9397d8e6100c370595ccdcd00ca0b (diff) | |
parent | 2628103f1df35ad6a130f2f41e73c7703bf61886 (diff) | |
download | dexon-cc0b451119478ba4a005ec8840573252636f45dc.tar dexon-cc0b451119478ba4a005ec8840573252636f45dc.tar.gz dexon-cc0b451119478ba4a005ec8840573252636f45dc.tar.bz2 dexon-cc0b451119478ba4a005ec8840573252636f45dc.tar.lz dexon-cc0b451119478ba4a005ec8840573252636f45dc.tar.xz dexon-cc0b451119478ba4a005ec8840573252636f45dc.tar.zst dexon-cc0b451119478ba4a005ec8840573252636f45dc.zip |
Merge pull request #1260 from obscuren/tx-drop-low-tx
core: drop low gas tx
Diffstat (limited to 'miner')
-rw-r--r-- | miner/miner.go | 2 | ||||
-rw-r--r-- | miner/worker.go | 7 |
2 files changed, 6 insertions, 3 deletions
diff --git a/miner/miner.go b/miner/miner.go index 20ca81648..7f73f3ee8 100644 --- a/miner/miner.go +++ b/miner/miner.go @@ -77,7 +77,7 @@ func (m *Miner) SetGasPrice(price *big.Int) { return } - m.worker.gasPrice = price + m.worker.setGasPrice(price) } func (self *Miner) Start(coinbase common.Address, threads int) { 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 } |