diff options
author | obscuren <geffobscura@gmail.com> | 2015-06-04 04:22:20 +0800 |
---|---|---|
committer | obscuren <geffobscura@gmail.com> | 2015-06-04 04:43:23 +0800 |
commit | d09a6e54215bef8b1ac16a99f0b1d75a8a92a6a8 (patch) | |
tree | ec8f89f562417a379c45c25d58b5de9b45bc0b04 /core/chain_manager.go | |
parent | 5197aed7dbba2ac19d99221efe33fede82007f5d (diff) | |
download | go-tangerine-d09a6e54215bef8b1ac16a99f0b1d75a8a92a6a8.tar.gz go-tangerine-d09a6e54215bef8b1ac16a99f0b1d75a8a92a6a8.tar.zst go-tangerine-d09a6e54215bef8b1ac16a99f0b1d75a8a92a6a8.zip |
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).
Diffstat (limited to 'core/chain_manager.go')
-rw-r--r-- | core/chain_manager.go | 21 |
1 files changed, 1 insertions, 20 deletions
diff --git a/core/chain_manager.go b/core/chain_manager.go index d58c0d504..d14a19fea 100644 --- a/core/chain_manager.go +++ b/core/chain_manager.go @@ -214,19 +214,6 @@ func (self *ChainManager) TransState() *state.StateDB { return self.transState } -func (self *ChainManager) TxState() *state.ManagedState { - self.tsmu.RLock() - defer self.tsmu.RUnlock() - - return self.txState -} - -func (self *ChainManager) setTxState(statedb *state.StateDB) { - self.tsmu.Lock() - defer self.tsmu.Unlock() - self.txState = state.ManageState(statedb) -} - func (self *ChainManager) setTransState(statedb *state.StateDB) { self.transState = statedb } @@ -751,7 +738,7 @@ out: case ev := <-events.Chan(): switch ev := ev.(type) { case queueEvent: - for i, event := range ev.queue { + for _, event := range ev.queue { switch event := event.(type) { case ChainEvent: // We need some control over the mining operation. Acquiring locks and waiting for the miner to create new block takes too long @@ -760,12 +747,6 @@ out: self.currentGasLimit = CalcGasLimit(event.Block) self.eventMux.Post(ChainHeadEvent{event.Block}) } - case ChainSplitEvent: - // On chain splits we need to reset the transaction state. We can't be sure whether the actual - // state of the accounts are still valid. - if i == ev.splitCount { - self.setTxState(state.New(event.Block.Root(), self.stateDb)) - } } self.eventMux.Post(event) |