RegisteredSNativeContracts

This commit is contained in:
Ethan Buchman
2015-07-21 13:30:24 -04:00
parent ecd231a8eb
commit ab536618e0
4 changed files with 36 additions and 22 deletions

View File

@ -424,8 +424,8 @@ func ExecTx(blockCache *BlockCache, tx types.Tx, runCall bool, evc events.Fireab
if outAcc == nil || len(outAcc.Code) == 0 {
// check if its an snative
trimmedAddr := TrimmedString(tx.Address)
if _, unknownPermErr := ptypes.SNativeStringToPermFlag(string(trimmedAddr)); unknownPermErr == nil {
// TODO: should we restrict from calling natives too?
if _, ok := vm.RegisteredSNativeContracts[LeftPadWord256(tx.Address)]; ok {
return fmt.Errorf("SNatives can not be called using CallTx. Either use a contract or a SNativeTx")
}