Skip to content

Commit

Permalink
GH-773 Make it obvious that controller.get_read_mode() is thread-safe.
Browse files Browse the repository at this point in the history
  • Loading branch information
heifner committed Sep 13, 2024
1 parent bc0bc8a commit 4bceee0
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 1 addition & 1 deletion libraries/chain/controller.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -953,7 +953,7 @@ struct controller_impl {
const chain_id_type chain_id; // read by thread_pool threads, value will not be changed
bool replaying = false;
bool is_producer_node = false; // true if node is configured as a block producer
db_read_mode read_mode = db_read_mode::HEAD;
const db_read_mode read_mode;
bool in_trx_requiring_checks = false; ///< if true, checks that are normally skipped on replay (e.g. auth checks) cannot be skipped
std::optional<fc::microseconds> subjective_cpu_leeway;
bool trusted_producer_light_validation = false;
Expand Down
2 changes: 2 additions & 0 deletions libraries/chain/include/eosio/chain/controller.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -394,8 +394,10 @@ namespace eosio::chain {

chain_id_type get_chain_id()const;

// thread safe
db_read_mode get_read_mode()const;
validation_mode get_validation_mode()const;

/// @return true if terminate-at-block reached
/// not-thread-safe
bool should_terminate() const;
Expand Down

0 comments on commit 4bceee0

Please sign in to comment.