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:
@ -206,6 +206,9 @@ func (self *VMEnv) StructLogs() []vm.StructLog {
|
||||
func (self *VMEnv) AddLog(log *state.Log) {
|
||||
self.state.AddLog(log)
|
||||
}
|
||||
func (self *VMEnv) CanTransfer(from vm.Account, balance *big.Int) bool {
|
||||
return from.Balance().Cmp(balance) >= 0
|
||||
}
|
||||
func (self *VMEnv) Transfer(from, to vm.Account, amount *big.Int) error {
|
||||
return vm.Transfer(from, to, amount)
|
||||
}
|
||||
|
Reference in New Issue
Block a user