mirror of
https://github.com/nspcc-dev/neo-go.git
synced 2024-11-27 03:58:06 +00:00
core: fix max contract description limit check
It differs from other parameters in C# code. Fixes #735.
This commit is contained in:
parent
4587121c7f
commit
eb404ceae3
1 changed files with 3 additions and 1 deletions
|
@ -17,6 +17,8 @@ import (
|
|||
)
|
||||
|
||||
const (
|
||||
// MaxContractDescriptionLen is the maximum length for contract description.
|
||||
MaxContractDescriptionLen = 65536
|
||||
// MaxContractScriptSize is the maximum script size for a contract.
|
||||
MaxContractScriptSize = 1024 * 1024
|
||||
// MaxContractParametersNum is the maximum number of parameters for a contract.
|
||||
|
@ -494,7 +496,7 @@ func (ic *interopContext) createContractStateFromVM(v *vm.VM) (*state.Contract,
|
|||
return nil, errors.New("too big email")
|
||||
}
|
||||
desc := v.Estack().Pop().Bytes()
|
||||
if len(desc) > MaxContractStringLen {
|
||||
if len(desc) > MaxContractDescriptionLen {
|
||||
return nil, errors.New("too big description")
|
||||
}
|
||||
contract := &state.Contract{
|
||||
|
|
Loading…
Reference in a new issue