core, core/vm, cmd/evm: remove redundant balance check

This commit is contained in:
Gustav Simonsson
2015-10-06 12:35:05 +02:00
parent 44fd395141
commit e1616f77c7
6 changed files with 10 additions and 19 deletions

View File

@ -17,7 +17,6 @@
package core
import (
"errors"
"math/big"
"github.com/ethereum/go-ethereum/common"
@ -108,13 +107,7 @@ func exec(env vm.Environment, caller vm.ContractRef, address, codeAddr *common.A
}
// generic transfer method
func Transfer(from, to vm.Account, amount *big.Int) error {
if from.Balance().Cmp(amount) < 0 {
return errors.New("Insufficient balance in account")
}
func Transfer(from, to vm.Account, amount *big.Int) {
from.SubBalance(amount)
to.AddBalance(amount)
return nil
}