core, tests: reduced state copy by N calls
Reduced the amount of state copied that are required by N calls by doing a balance check prior to any state modifications.
This commit is contained in:
@ -105,6 +105,9 @@ func (self *Env) AddLog(log *state.Log) {
|
||||
}
|
||||
func (self *Env) Depth() int { return self.depth }
|
||||
func (self *Env) SetDepth(i int) { self.depth = i }
|
||||
func (self *Env) CanTransfer(from Account, balance *big.Int) bool {
|
||||
return from.Balance().Cmp(balance) >= 0
|
||||
}
|
||||
func (self *Env) Transfer(from, to Account, amount *big.Int) error {
|
||||
return nil
|
||||
}
|
||||
|
Reference in New Issue
Block a user