vm, core: move invocation counter from InteropContext to VM
This commit is contained in:
parent
45bfce60a5
commit
6ce00fde82
5 changed files with 8 additions and 6 deletions
|
@ -59,10 +59,10 @@ func GetNotifications(ic *interop.Context) error {
|
|||
// GetInvocationCounter returns how many times current contract was invoked during current tx execution.
|
||||
func GetInvocationCounter(ic *interop.Context) error {
|
||||
currentScriptHash := ic.VM.GetCurrentScriptHash()
|
||||
count, ok := ic.Invocations[currentScriptHash]
|
||||
count, ok := ic.VM.Invocations[currentScriptHash]
|
||||
if !ok {
|
||||
count = 1
|
||||
ic.Invocations[currentScriptHash] = count
|
||||
ic.VM.Invocations[currentScriptHash] = count
|
||||
}
|
||||
ic.VM.Estack().PushVal(count)
|
||||
return nil
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue