Browse Source

remove unnecessary permission check

pull/124/head
Jae Kwon 9 years ago
parent
commit
aada207092
1 changed files with 4 additions and 10 deletions
  1. +4
    -10
      state/execution.go

+ 4
- 10
state/execution.go View File

@ -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))


Loading…
Cancel
Save