From d09a6e54215bef8b1ac16a99f0b1d75a8a92a6a8 Mon Sep 17 00:00:00 2001 From: obscuren Date: Wed, 3 Jun 2015 22:22:20 +0200 Subject: core, eth, miner: moved nonce management to tx pool. Removed the managed tx state from the chain manager to the transaction pool where it's much easier to keep track of nonces (and manage them). The transaction pool now also uses the queue and pending txs differently where queued txs are now moved over to the pending queue (i.e. txs ready for processing and propagation). --- miner/worker.go | 4 ---- 1 file changed, 4 deletions(-) (limited to 'miner') diff --git a/miner/worker.go b/miner/worker.go index 58efd61db..1580d4d42 100644 --- a/miner/worker.go +++ b/miner/worker.go @@ -494,10 +494,6 @@ func (self *worker) commitTransactions(transactions types.Transactions) { err := self.commitTransaction(tx) switch { case core.IsNonceErr(err) || core.IsInvalidTxErr(err): - // Remove invalid transactions - from, _ := tx.From() - - self.chain.TxState().RemoveNonce(from, tx.Nonce()) current.remove.Add(tx.Hash()) if glog.V(logger.Detail) { -- cgit v1.2.3 From a9c058dfe0fe67b6482e591c83852732e81beb64 Mon Sep 17 00:00:00 2001 From: Jason Carver Date: Mon, 8 Jun 2015 11:49:59 -0700 Subject: crash fix: skip deep log if self.chain is not caught up @see trace https://gist.github.com/eupraxic/87fdfefe702c51d5944d --- miner/worker.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'miner') diff --git a/miner/worker.go b/miner/worker.go index 1580d4d42..611445529 100644 --- a/miner/worker.go +++ b/miner/worker.go @@ -352,7 +352,7 @@ func (self *worker) isBlockLocallyMined(deepBlockNum uint64) bool { //Does the block at {deepBlockNum} send earnings to my coinbase? var block = self.chain.GetBlockByNumber(deepBlockNum) - return block.Header().Coinbase == self.coinbase + return block != nil && block.Header().Coinbase == self.coinbase } func (self *worker) logLocalMinedBlocks(previous *environment) { -- cgit v1.2.3