forked from TrueCloudLab/neoneo-go
core: restrict the maximum number of contract updates
This commit is contained in:
parent
42e4021898
commit
ffdcdf4a95
1 changed files with 3 additions and 0 deletions
|
@ -353,6 +353,9 @@ func (m *Management) Update(d *dao.Simple, hash util.Uint160, neff *nef.File, ma
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, errors.New("contract doesn't exist")
|
return nil, errors.New("contract doesn't exist")
|
||||||
}
|
}
|
||||||
|
if oldcontract.UpdateCounter == math.MaxUint16 {
|
||||||
|
return nil, errors.New("the contract reached the maximum number of updates")
|
||||||
|
}
|
||||||
|
|
||||||
contract = *oldcontract // Make a copy, don't ruin (potentially) cached contract.
|
contract = *oldcontract // Make a copy, don't ruin (potentially) cached contract.
|
||||||
// if NEF was provided, update the contract script
|
// if NEF was provided, update the contract script
|
||||||
|
|
Loading…
Reference in a new issue