Make functions non-const
This commit is contained in:
parent
d84ffb7219
commit
d61ea9f4c7
6 changed files with 14 additions and 14 deletions
|
@ -975,7 +975,7 @@ bool nano::node::collect_ledger_pruning_targets (std::deque<nano::block_hash> &
|
|||
{
|
||||
uint64_t read_operations (0);
|
||||
bool finish_transaction (false);
|
||||
auto const transaction = ledger.tx_begin_read ();
|
||||
auto transaction = ledger.tx_begin_read ();
|
||||
for (auto i (store.confirmation_height.begin (transaction, last_account_a)), n (store.confirmation_height.end ()); i != n && !finish_transaction;)
|
||||
{
|
||||
++read_operations;
|
||||
|
|
|
@ -68,7 +68,7 @@ bool nano::scheduler::hinted::predicate () const
|
|||
return active.vacancy (nano::election_behavior::hinted) > 0;
|
||||
}
|
||||
|
||||
void nano::scheduler::hinted::activate (secure::read_transaction const & transaction, nano::block_hash const & hash, bool check_dependents)
|
||||
void nano::scheduler::hinted::activate (secure::read_transaction & transaction, nano::block_hash const & hash, bool check_dependents)
|
||||
{
|
||||
const int max_iterations = 64;
|
||||
|
||||
|
|
|
@ -71,7 +71,7 @@ private:
|
|||
bool predicate () const;
|
||||
void run ();
|
||||
void run_iterative ();
|
||||
void activate (secure::read_transaction const &, nano::block_hash const & hash, bool check_dependents);
|
||||
void activate (secure::read_transaction &, nano::block_hash const & hash, bool check_dependents);
|
||||
|
||||
nano::uint128_t tally_threshold () const;
|
||||
nano::uint128_t final_tally_threshold () const;
|
||||
|
|
|
@ -108,12 +108,12 @@ public:
|
|||
return txn;
|
||||
}
|
||||
|
||||
void refresh () const
|
||||
void refresh ()
|
||||
{
|
||||
txn.refresh ();
|
||||
}
|
||||
|
||||
void refresh_if_needed (std::chrono::milliseconds max_age = std::chrono::milliseconds{ 500 }) const
|
||||
void refresh_if_needed (std::chrono::milliseconds max_age = std::chrono::milliseconds{ 500 })
|
||||
{
|
||||
txn.refresh_if_needed (max_age);
|
||||
}
|
||||
|
|
|
@ -49,24 +49,24 @@ nano::id_dispenser::id_t nano::store::read_transaction::store_id () const
|
|||
return impl->store_id;
|
||||
}
|
||||
|
||||
void nano::store::read_transaction::reset () const
|
||||
void nano::store::read_transaction::reset ()
|
||||
{
|
||||
impl->reset ();
|
||||
}
|
||||
|
||||
void nano::store::read_transaction::renew () const
|
||||
void nano::store::read_transaction::renew ()
|
||||
{
|
||||
impl->renew ();
|
||||
start = std::chrono::steady_clock::now ();
|
||||
}
|
||||
|
||||
void nano::store::read_transaction::refresh () const
|
||||
void nano::store::read_transaction::refresh ()
|
||||
{
|
||||
reset ();
|
||||
renew ();
|
||||
}
|
||||
|
||||
void nano::store::read_transaction::refresh_if_needed (std::chrono::milliseconds max_age) const
|
||||
void nano::store::read_transaction::refresh_if_needed (std::chrono::milliseconds max_age)
|
||||
{
|
||||
auto now = std::chrono::steady_clock::now ();
|
||||
if (now - start > max_age)
|
||||
|
|
|
@ -53,14 +53,14 @@ public:
|
|||
void * get_handle () const override;
|
||||
nano::id_dispenser::id_t store_id () const override;
|
||||
|
||||
void reset () const;
|
||||
void renew () const;
|
||||
void refresh () const;
|
||||
void refresh_if_needed (std::chrono::milliseconds max_age = std::chrono::milliseconds{ 500 }) const;
|
||||
void reset ();
|
||||
void renew ();
|
||||
void refresh ();
|
||||
void refresh_if_needed (std::chrono::milliseconds max_age = std::chrono::milliseconds{ 500 });
|
||||
|
||||
private:
|
||||
std::unique_ptr<read_transaction_impl> impl;
|
||||
mutable std::chrono::steady_clock::time_point start;
|
||||
std::chrono::steady_clock::time_point start;
|
||||
};
|
||||
|
||||
/**
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue