mirror of
https://github.com/ton-blockchain/ton
synced 2025-02-15 04:32:21 +00:00
Improve gas consumption in VmState::jump_to (#1276)
This commit is contained in:
parent
3e806bf46e
commit
5920f800de
1 changed files with 4 additions and 4 deletions
|
@ -373,11 +373,11 @@ class VmState final : public VmStateInterface {
|
||||||
int jump_to(Ref<Continuation> cont) {
|
int jump_to(Ref<Continuation> cont) {
|
||||||
int res = 0, cnt = 0;
|
int res = 0, cnt = 0;
|
||||||
while (cont.not_null()) {
|
while (cont.not_null()) {
|
||||||
cnt++;
|
|
||||||
cont = cont->is_unique() ? cont.unique_write().jump_w(this, res) : cont->jump(this, res);
|
cont = cont->is_unique() ? cont.unique_write().jump_w(this, res) : cont->jump(this, res);
|
||||||
|
cnt++;
|
||||||
|
if (cnt > free_nested_cont_jump && global_version >= 9) {
|
||||||
|
consume_gas(1);
|
||||||
}
|
}
|
||||||
if (global_version >= 9 && cnt > free_nested_cont_jump) {
|
|
||||||
consume_gas(cnt - free_nested_cont_jump);
|
|
||||||
}
|
}
|
||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue