Skip to content

Commit

Permalink
Renaming block_processor::process_x functions. They no longer directl…
Browse files Browse the repository at this point in the history
…y receive which made their names inaccurate. (#1558)
  • Loading branch information
clemahieu authored Jan 5, 2019
1 parent 3852b91 commit ab82569
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion nano/core_test/gap_cache.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ TEST (gap_cache, gap_bootstrap)
auto send (std::make_shared<nano::send_block> (latest, key.pub, nano::genesis_amount - 100, nano::test_genesis_key.prv, nano::test_genesis_key.pub, system.work.generate (latest)));
{
auto transaction (system.nodes[0]->store.tx_begin (true));
ASSERT_EQ (nano::process_result::progress, system.nodes[0]->block_processor.process_receive_one (transaction, send).code);
ASSERT_EQ (nano::process_result::progress, system.nodes[0]->block_processor.process_one (transaction, send).code);
}
ASSERT_EQ (nano::genesis_amount - 100, system.nodes[0]->balance (nano::genesis_account));
ASSERT_EQ (nano::genesis_amount, system.nodes[1]->balance (nano::genesis_account));
Expand Down
10 changes: 5 additions & 5 deletions nano/node/node.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1265,7 +1265,7 @@ void nano::block_processor::process_blocks ()
{
active = true;
lock.unlock ();
process_receive_many (lock);
process_batch (lock);
lock.lock ();
active = false;
}
Expand Down Expand Up @@ -1362,7 +1362,7 @@ void nano::block_processor::verify_state_blocks (std::unique_lock<std::mutex> &
}
}

void nano::block_processor::process_receive_many (std::unique_lock<std::mutex> & lock_a)
void nano::block_processor::process_batch (std::unique_lock<std::mutex> & lock_a)
{
lock_a.lock ();
auto start_time (std::chrono::steady_clock::now ());
Expand Down Expand Up @@ -1431,7 +1431,7 @@ void nano::block_processor::process_receive_many (std::unique_lock<std::mutex> &
/* Forced state blocks are not validated in verify_state_blocks () function
Because of that we should set set validated_state_block as "false" for forced state blocks (!force) */
bool validated_state_block (!force && block.first->type () == nano::block_type::state);
auto process_result (process_receive_one (transaction, block.first, block.second, validated_state_block));
auto process_result (process_one (transaction, block.first, block.second, validated_state_block));
number_of_blocks_processed++;
(void)process_result;
lock_a.lock ();
Expand All @@ -1454,7 +1454,7 @@ void nano::block_processor::process_receive_many (std::unique_lock<std::mutex> &
}
}

nano::process_return nano::block_processor::process_receive_one (nano::transaction const & transaction_a, std::shared_ptr<nano::block> block_a, std::chrono::steady_clock::time_point origination, bool validated_state_block)
nano::process_return nano::block_processor::process_one (nano::transaction const & transaction_a, std::shared_ptr<nano::block> block_a, std::chrono::steady_clock::time_point origination, bool validated_state_block)
{
nano::process_return result;
auto hash (block_a->hash ());
Expand Down Expand Up @@ -2653,7 +2653,7 @@ void nano::node::process_confirmed (std::shared_ptr<nano::block> block_a)
if (!exists)
{
auto transaction (store.tx_begin_write ());
block_processor.process_receive_one (transaction, block_a);
block_processor.process_one (transaction, block_a);
exists = store.block_exists (transaction, block_a->type (), hash);
}
if (exists)
Expand Down
4 changes: 2 additions & 2 deletions nano/node/node.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -425,12 +425,12 @@ class block_processor
bool should_log (bool);
bool have_blocks ();
void process_blocks ();
nano::process_return process_receive_one (nano::transaction const &, std::shared_ptr<nano::block>, std::chrono::steady_clock::time_point = std::chrono::steady_clock::now (), bool = false);
nano::process_return process_one (nano::transaction const &, std::shared_ptr<nano::block>, std::chrono::steady_clock::time_point = std::chrono::steady_clock::now (), bool = false);

private:
void queue_unchecked (nano::transaction const &, nano::block_hash const &);
void verify_state_blocks (std::unique_lock<std::mutex> &, size_t = std::numeric_limits<size_t>::max ());
void process_receive_many (std::unique_lock<std::mutex> &);
void process_batch (std::unique_lock<std::mutex> &);
bool stopped;
bool active;
std::chrono::steady_clock::time_point next_log;
Expand Down
2 changes: 1 addition & 1 deletion nano/node/rpc.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2409,7 +2409,7 @@ void nano::rpc_handler::process ()
nano::process_return result;
{
auto transaction (node.store.tx_begin_write ());
result = node.block_processor.process_receive_one (transaction, block, std::chrono::steady_clock::time_point ());
result = node.block_processor.process_one (transaction, block, std::chrono::steady_clock::time_point ());
}
switch (result.code)
{
Expand Down

0 comments on commit ab82569

Please sign in to comment.