Skip to content

Commit

Permalink
Do not hold transaction in json_handler::blocks_info
Browse files Browse the repository at this point in the history
  • Loading branch information
pwojcikdev committed Jan 17, 2024
1 parent 250ed20 commit 0667b05
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions nano/node/json_handler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1295,11 +1295,15 @@ void nano::json_handler::blocks_info ()

boost::property_tree::ptree blocks;
boost::property_tree::ptree blocks_not_found;
auto transaction (node.store.tx_begin_read ());
for (boost::property_tree::ptree::value_type & hashes : request.get_child ("hashes"))

{
if (!ec)
auto transaction (node.store.tx_begin_read ());
for (boost::property_tree::ptree::value_type & hashes : request.get_child ("hashes"))
{
if (ec)
{
break;
}
std::string hash_text = hashes.second.data ();
nano::block_hash hash;
if (!hash.decode_hex (hash_text))
Expand Down

0 comments on commit 0667b05

Please sign in to comment.