Cleaned up
Removed the unneeded address watch mechanism. State manager's transient state should now take care of this.
This commit is contained in:
@ -160,33 +160,8 @@ func (c *StateObject) RlpDecode(data []byte) {
|
||||
c.script = decoder.Get(3).Bytes()
|
||||
}
|
||||
|
||||
// The cached state and state object cache are helpers which will give you somewhat
|
||||
// control over the nonce. When creating new transactions you're interested in the 'next'
|
||||
// nonce rather than the current nonce. This to avoid creating invalid-nonce transactions.
|
||||
type StateObjectCache struct {
|
||||
cachedObjects map[string]*CachedStateObject
|
||||
}
|
||||
|
||||
func NewStateObjectCache() *StateObjectCache {
|
||||
return &StateObjectCache{cachedObjects: make(map[string]*CachedStateObject)}
|
||||
}
|
||||
|
||||
func (s *StateObjectCache) Add(addr []byte, object *StateObject) *CachedStateObject {
|
||||
state := &CachedStateObject{Nonce: object.Nonce, Object: object}
|
||||
s.cachedObjects[string(addr)] = state
|
||||
|
||||
return state
|
||||
}
|
||||
|
||||
func (s *StateObjectCache) Get(addr []byte) *CachedStateObject {
|
||||
return s.cachedObjects[string(addr)]
|
||||
}
|
||||
|
||||
type CachedStateObject struct {
|
||||
Nonce uint64
|
||||
Object *StateObject
|
||||
}
|
||||
|
||||
// Storage change object. Used by the manifest for notifying changes to
|
||||
// the sub channels.
|
||||
type StorageState struct {
|
||||
StateAddress []byte
|
||||
Address []byte
|
||||
|
Reference in New Issue
Block a user