diff options
author | Jeffrey Wilcke <geffobscura@gmail.com> | 2015-08-02 08:20:41 +0800 |
---|---|---|
committer | Jeffrey Wilcke <geffobscura@gmail.com> | 2015-08-07 18:52:23 +0800 |
commit | 184e9ae9a81df2db6381e18d3daa035d913ae341 (patch) | |
tree | 1404780c9d9772b797ff979594e7468ca382d2b6 /cmd | |
parent | 846f34f78b5f76233655d0cf3611706e99f2efe2 (diff) | |
download | dexon-184e9ae9a81df2db6381e18d3daa035d913ae341.tar.gz dexon-184e9ae9a81df2db6381e18d3daa035d913ae341.tar.zst dexon-184e9ae9a81df2db6381e18d3daa035d913ae341.zip |
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.
Diffstat (limited to 'cmd')
-rw-r--r-- | cmd/evm/main.go | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/cmd/evm/main.go b/cmd/evm/main.go index 7dd375b14..be6546c95 100644 --- a/cmd/evm/main.go +++ b/cmd/evm/main.go @@ -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) } |