Adding const to ledger::weight* functions. (#4534)
This commit is contained in:
parent
311bf685bf
commit
a304dd5617
2 changed files with 5 additions and 5 deletions
|
|
@ -981,7 +981,7 @@ std::pair<nano::block_hash, nano::block_hash> nano::ledger::hash_root_random (st
|
||||||
}
|
}
|
||||||
|
|
||||||
// Vote weight of an account
|
// Vote weight of an account
|
||||||
nano::uint128_t nano::ledger::weight (nano::account const & account_a)
|
nano::uint128_t nano::ledger::weight (nano::account const & account_a) const
|
||||||
{
|
{
|
||||||
if (check_bootstrap_weights.load ())
|
if (check_bootstrap_weights.load ())
|
||||||
{
|
{
|
||||||
|
|
@ -1001,7 +1001,7 @@ nano::uint128_t nano::ledger::weight (nano::account const & account_a)
|
||||||
return cache.rep_weights.representation_get (account_a);
|
return cache.rep_weights.representation_get (account_a);
|
||||||
}
|
}
|
||||||
|
|
||||||
nano::uint128_t nano::ledger::weight_exact (store::transaction const & txn_a, nano::account const & representative_a)
|
nano::uint128_t nano::ledger::weight_exact (store::transaction const & txn_a, nano::account const & representative_a) const
|
||||||
{
|
{
|
||||||
return store.rep_weight.get (txn_a, representative_a);
|
return store.rep_weight.get (txn_a, representative_a);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -50,11 +50,11 @@ public:
|
||||||
* If the weight is below the cache limit it returns 0.
|
* If the weight is below the cache limit it returns 0.
|
||||||
* During bootstrap it returns the preconfigured bootstrap weights.
|
* During bootstrap it returns the preconfigured bootstrap weights.
|
||||||
*/
|
*/
|
||||||
nano::uint128_t weight (nano::account const &);
|
nano::uint128_t weight (nano::account const &) const;
|
||||||
std::optional<nano::block_hash> successor (store::transaction const &, nano::qualified_root const &) const noexcept;
|
std::optional<nano::block_hash> successor (store::transaction const &, nano::qualified_root const &) const noexcept;
|
||||||
std::optional<nano::block_hash> successor (store::transaction const & transaction, nano::block_hash const & hash) const noexcept;
|
std::optional<nano::block_hash> successor (store::transaction const & transaction, nano::block_hash const & hash) const noexcept;
|
||||||
/* Returns the exact vote weight for the given representative by doing a database lookup */
|
/* Returns the exact vote weight for the given representative by doing a database lookup */
|
||||||
nano::uint128_t weight_exact (store::transaction const &, nano::account const &);
|
nano::uint128_t weight_exact (store::transaction const &, nano::account const &) const;
|
||||||
std::shared_ptr<nano::block> forked_block (store::transaction const &, nano::block const &);
|
std::shared_ptr<nano::block> forked_block (store::transaction const &, nano::block const &);
|
||||||
std::shared_ptr<nano::block> head_block (store::transaction const &, nano::account const &);
|
std::shared_ptr<nano::block> head_block (store::transaction const &, nano::account const &);
|
||||||
bool block_confirmed (store::transaction const &, nano::block_hash const &) const;
|
bool block_confirmed (store::transaction const &, nano::block_hash const &) const;
|
||||||
|
|
@ -105,7 +105,7 @@ public:
|
||||||
nano::stats & stats;
|
nano::stats & stats;
|
||||||
std::unordered_map<nano::account, nano::uint128_t> bootstrap_weights;
|
std::unordered_map<nano::account, nano::uint128_t> bootstrap_weights;
|
||||||
uint64_t bootstrap_weight_max_blocks{ 1 };
|
uint64_t bootstrap_weight_max_blocks{ 1 };
|
||||||
std::atomic<bool> check_bootstrap_weights;
|
mutable std::atomic<bool> check_bootstrap_weights;
|
||||||
bool pruning{ false };
|
bool pruning{ false };
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue