contract: disable notifications for safe methods

See neo-project/neo#2339.
This commit is contained in:
Roman Khimov 2021-03-16 22:47:49 +03:00
parent 025330f132
commit 304b9ad3d4

View file

@ -73,7 +73,7 @@ func callInternal(ic *interop.Context, cs *state.Contract, name string, f callfl
hasReturn bool, args []stackitem.Item) error {
md := cs.Manifest.ABI.GetMethod(name, len(args))
if md.Safe {
f &^= callflag.WriteStates
f &^= (callflag.WriteStates | callflag.AllowNotify)
} else if ctx := ic.VM.Context(); ctx != nil && ctx.IsDeployed() {
curr, err := ic.GetContract(ic.VM.GetCurrentScriptHash())
if err == nil {