Adding unchecked, synchronizing, blocks to block_count RPC.
This commit is contained in:
parent
e2ea7876b6
commit
8c250966e5
2 changed files with 3 additions and 2 deletions
|
@ -1446,6 +1446,7 @@ TEST (rpc, block_count)
|
|||
}
|
||||
ASSERT_EQ (200, response1.status);
|
||||
ASSERT_EQ ("1", response1.json.get <std::string> ("count"));
|
||||
ASSERT_EQ ("0", response1.json.get <std::string> ("unchecked"));
|
||||
}
|
||||
|
||||
TEST (rpc, frontier_count)
|
||||
|
|
|
@ -452,9 +452,9 @@ void rai::rpc_handler::block_account ()
|
|||
void rai::rpc_handler::block_count ()
|
||||
{
|
||||
rai::transaction transaction (rpc.node.store.environment, nullptr, false);
|
||||
auto size (rpc.node.store.block_count (transaction));
|
||||
boost::property_tree::ptree response_l;
|
||||
response_l.put ("count", std::to_string (size));
|
||||
response_l.put ("count", std::to_string (rpc.node.store.block_count (transaction)));
|
||||
response_l.put ("unchecked", std::to_string (rpc.node.store.unchecked_count (transaction)));
|
||||
rpc.send_response (response, response_l);
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue