From f4141598da895a16496964f30ebd21dba5513954 Mon Sep 17 00:00:00 2001 From: Wesley Shillingford Date: Sun, 29 Sep 2019 11:49:57 +0100 Subject: [PATCH] Remove querying pending confirmation queue in RPCs and wallet (#2156) --- nano/node/json_handler.cpp | 8 ++++---- nano/node/wallet.cpp | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/nano/node/json_handler.cpp b/nano/node/json_handler.cpp index 9ca85da6..34b08833 100644 --- a/nano/node/json_handler.cpp +++ b/nano/node/json_handler.cpp @@ -954,7 +954,7 @@ void nano::json_handler::block_info () response_l.put ("balance", balance.convert_to ()); 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 ("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 ()); 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; } diff --git a/nano/node/wallet.cpp b/nano/node/wallet.cpp index 0eefd0fc..896e349c 100644 --- a/nano/node/wallet.cpp +++ b/nano/node/wallet.cpp @@ -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 ());