aboutsummaryrefslogtreecommitdiffstats
path: root/ethchain/state_manager.go
diff options
context:
space:
mode:
authorobscuren <geffobscura@gmail.com>2014-05-09 00:41:45 +0800
committerobscuren <geffobscura@gmail.com>2014-05-09 00:41:45 +0800
commite8fb965ccbb65807c1f462e8f2ee82508a822b58 (patch)
tree862ac20a37a1ae00989258c7234be5bbf3bb833e /ethchain/state_manager.go
parentd709815106824a3469b5f4152fd32705d7d142d4 (diff)
downloadgo-tangerine-e8fb965ccbb65807c1f462e8f2ee82508a822b58.tar
go-tangerine-e8fb965ccbb65807c1f462e8f2ee82508a822b58.tar.gz
go-tangerine-e8fb965ccbb65807c1f462e8f2ee82508a822b58.tar.bz2
go-tangerine-e8fb965ccbb65807c1f462e8f2ee82508a822b58.tar.lz
go-tangerine-e8fb965ccbb65807c1f462e8f2ee82508a822b58.tar.xz
go-tangerine-e8fb965ccbb65807c1f462e8f2ee82508a822b58.tar.zst
go-tangerine-e8fb965ccbb65807c1f462e8f2ee82508a822b58.zip
Cleaned up
Removed the unneeded address watch mechanism. State manager's transient state should now take care of this.
Diffstat (limited to 'ethchain/state_manager.go')
-rw-r--r--ethchain/state_manager.go33
1 files changed, 9 insertions, 24 deletions
diff --git a/ethchain/state_manager.go b/ethchain/state_manager.go
index fb5753ab3..76b02f9ab 100644
--- a/ethchain/state_manager.go
+++ b/ethchain/state_manager.go
@@ -25,24 +25,16 @@ type EthManager interface {
type StateManager struct {
// Mutex for locking the block processor. Blocks can only be handled one at a time
mutex sync.Mutex
-
// Canonical block chain
bc *BlockChain
- // States for addresses. You can watch any address
- // at any given time
- stateObjectCache *StateObjectCache
-
// Stack for processing contracts
stack *Stack
// non-persistent key/value memory storage
mem map[string]*big.Int
-
+ // Proof of work used for validating
Pow PoW
-
+ // The ethereum manager interface
Ethereum EthManager
-
- SecondaryBlockProcessor BlockProcessor
-
// The managed states
// Processor state. Anything processed will be applied to this
// state
@@ -54,19 +46,18 @@ type StateManager struct {
// it could be used for setting account nonces without effecting
// the main states.
transState *State
-
+ // Manifest for keeping changes regarding state objects. See `notify`
manifest *Manifest
}
func NewStateManager(ethereum EthManager) *StateManager {
sm := &StateManager{
- stack: NewStack(),
- mem: make(map[string]*big.Int),
- Pow: &EasyPow{},
- Ethereum: ethereum,
- stateObjectCache: NewStateObjectCache(),
- bc: ethereum.BlockChain(),
- manifest: NewManifest(),
+ stack: NewStack(),
+ mem: make(map[string]*big.Int),
+ Pow: &EasyPow{},
+ Ethereum: ethereum,
+ bc: ethereum.BlockChain(),
+ manifest: NewManifest(),
}
sm.procState = ethereum.BlockChain().CurrentBlock.State()
sm.transState = sm.procState.Copy()
@@ -193,12 +184,6 @@ func (sm *StateManager) ProcessBlock(block *Block, dontReact bool) error {
// Add the block to the chain
sm.bc.Add(block)
- // If there's a block processor present, pass in the block for further
- // processing
- if sm.SecondaryBlockProcessor != nil {
- sm.SecondaryBlockProcessor.ProcessBlock(block)
- }
-
ethutil.Config.Log.Infof("[STATE] Added block #%d (%x)\n", block.BlockInfo().Number, block.Hash())
if dontReact == false {
sm.Ethereum.Reactor().Post("newBlock", block)