Skip to content

Commit

Permalink
Revert "Rewrite wallet::search_receivable in terms of receivable iter…
Browse files Browse the repository at this point in the history
…ators"

This reverts commit 30a3cc2.

# Conflicts:
#	nano/node/wallet.cpp
  • Loading branch information
clemahieu committed Aug 21, 2024
1 parent be764b0 commit df2f06d
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions nano/node/wallet.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1185,14 +1185,15 @@ bool nano::wallet::search_receivable (store::transaction const & wallet_transact
// Don't search pending for watch-only accounts
if (!nano::wallet_value (i->second).key.is_zero ())
{
for (auto i = wallets.node.ledger.any.receivable_upper_bound (block_transaction, account, 0), n = wallets.node.ledger.any.receivable_end (); i != n; ++i)
for (auto j (wallets.node.store.pending.begin (block_transaction, nano::pending_key (account, 0))), k (wallets.node.store.pending.end ()); j != k && nano::pending_key (j->first).account == account; ++j)
{
auto const & [key, info] = *i;
auto hash = key.hash;
auto amount = info.amount.number ();
nano::pending_key key (j->first);
auto hash (key.hash);
nano::pending_info pending (j->second);
auto amount (pending.amount.number ());
if (wallets.node.config.receive_minimum.number () <= amount)
{
wallets.node.logger.info (nano::log::type::wallet, "Found a receivable block {} for account {}", hash.to_string (), info.source.to_account ());
wallets.node.logger.info (nano::log::type::wallet, "Found a receivable block {} for account {}", hash.to_string (), pending.source.to_account ());

if (wallets.node.ledger.confirmed.block_exists_or_pruned (block_transaction, hash))
{
Expand Down

0 comments on commit df2f06d

Please sign in to comment.