From aada2070920e93b6bcaff2df0a0c044c54d54fa3 Mon Sep 17 00:00:00 2001 From: Jae Kwon Date: Fri, 31 Jul 2015 16:25:12 -0700 Subject: [PATCH] remove unnecessary permission check --- state/execution.go | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) diff --git a/state/execution.go b/state/execution.go index d935666e..41d35edf 100644 --- a/state/execution.go +++ b/state/execution.go @@ -449,16 +449,10 @@ func ExecTx(blockCache *BlockCache, tx types.Tx, runCall bool, evc events.Fireab // get or create callee if createContract { - if HasPermission(blockCache, inAcc, ptypes.CreateContract) { - callee = txCache.CreateAccount(caller) - log.Info(Fmt("Created new contract %X", callee.Address)) - code = tx.Data - } else { - log.Info(Fmt("Error on execution: Caller %X cannot create contract", - caller.Address)) - err = types.ErrTxPermissionDenied - goto CALL_COMPLETE - } + // We already checked for permission + callee = txCache.CreateAccount(caller) + log.Info(Fmt("Created new contract %X", callee.Address)) + code = tx.Data } else { callee = toVMAccount(outAcc) log.Info(Fmt("Calling contract %X with code %X", callee.Address, callee.Code))