Use memory weight instead of exact weight. (#4555)

This commit is contained in:
clemahieu 2024-04-13 20:34:44 +01:00 committed by GitHub
commit 30a0d1e311
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -1644,12 +1644,7 @@ nano::wallet_representatives nano::wallets::reps () const
bool nano::wallets::check_rep (nano::account const & account_a, nano::uint128_t const & half_principal_weight_a, bool const acquire_lock_a)
{
nano::uint128_t weight;
{
auto ledger_txn{ node.ledger.store.tx_begin_read () };
weight = node.ledger.weight_exact (ledger_txn, account_a);
}
auto weight = node.ledger.weight (account_a);
if (weight < node.config.vote_minimum.number ())
{
return false; // account not a representative