Remove querying pending confirmation queue in RPCs and wallet (#2156)

This commit is contained in:
Wesley Shillingford 2019-09-29 11:49:57 +01:00 committed by GitHub
commit f4141598da
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 5 deletions

View file

@ -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);
@ -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));
@ -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)
@ -4805,7 +4805,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;
}

View file

@ -1265,7 +1265,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 ());