Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove querying pending confirmation height in various operations #2156

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions nano/node/json_handler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -954,7 +954,7 @@ void nano::json_handler::block_info ()
response_l.put ("balance", balance.convert_to<std::string> ());
response_l.put ("height", std::to_string (sideband.height));
response_l.put ("local_timestamp", std::to_string (sideband.timestamp));
auto confirmed (node.block_confirmed_or_being_confirmed (transaction, hash));
auto confirmed (node.ledger.block_confirmed (transaction, hash));
response_l.put ("confirmed", confirmed);

bool json_block_l = request.get<bool> ("json_block", false);
Expand Down Expand Up @@ -992,7 +992,7 @@ void nano::json_handler::block_confirm ()
auto block_l (node.store.block_get (transaction, hash));
if (block_l != nullptr)
{
if (!node.block_confirmed_or_being_confirmed (transaction, hash))
if (!node.ledger.block_confirmed (transaction, hash))
{
// Start new confirmation for unconfirmed block
node.block_confirm (std::move (block_l));
Expand Down Expand Up @@ -1105,7 +1105,7 @@ void nano::json_handler::blocks_info ()
entry.put ("balance", balance.convert_to<std::string> ());
entry.put ("height", std::to_string (sideband.height));
entry.put ("local_timestamp", std::to_string (sideband.timestamp));
auto confirmed (node.block_confirmed_or_being_confirmed (transaction, hash));
auto confirmed (node.ledger.block_confirmed (transaction, hash));
entry.put ("confirmed", confirmed);

if (json_block_l)
Expand Down Expand Up @@ -4782,7 +4782,7 @@ bool block_confirmed (nano::node & node, nano::transaction & transaction, nano::
is_confirmed = true;
}
// Check whether the confirmation height is set
else if (node.block_confirmed_or_being_confirmed (transaction, hash))
else if (node.ledger.block_confirmed (transaction, hash))
{
is_confirmed = true;
}
Expand Down
2 changes: 1 addition & 1 deletion nano/node/wallet.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1257,7 +1257,7 @@ bool nano::wallet::search_pending ()
{
wallets.node.logger.try_log (boost::str (boost::format ("Found a pending block %1% for account %2%") % hash.to_string () % pending.source.to_account ()));
auto block (wallets.node.store.block_get (block_transaction, hash));
if (wallets.node.block_confirmed_or_being_confirmed (block_transaction, hash))
if (wallets.node.ledger.block_confirmed (block_transaction, hash))
{
// Receive confirmed block
auto node_l (wallets.node.shared ());
Expand Down