Skip to content

Commit

Permalink
GH-1251 Add is_applying_block() method
Browse files Browse the repository at this point in the history
  • Loading branch information
heifner committed Jun 23, 2023
1 parent 98e3b81 commit d4ee46b
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
2 changes: 1 addition & 1 deletion libraries/chain/apply_context.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1104,7 +1104,7 @@ action_name apply_context::get_sender() const {
// Read only trx | OC
bool apply_context::should_use_eos_vm_oc()const {
return receiver.prefix() == config::system_account_name // "eosio"_n, all cases use OC
|| (trx_context.explicit_billed_cpu_time && !control.is_producer_node()) // validating/applying block
|| (is_applying_block() && !control.is_producer_node()) // validating/applying block
|| trx_context.is_read_only();
}

Expand Down
1 change: 1 addition & 0 deletions libraries/chain/include/eosio/chain/apply_context.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -598,6 +598,7 @@ class apply_context {

action_name get_sender() const;

bool is_applying_block() const { return trx_context.explicit_billed_cpu_time; }
bool should_use_eos_vm_oc()const;

/// Fields:
Expand Down

0 comments on commit d4ee46b

Please sign in to comment.