Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixing issue where blocks were not being rebroadcast immediately upon… #1657

Merged
merged 10 commits into from
Jan 30, 2019
19 changes: 14 additions & 5 deletions nano/node/node.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1620,6 +1620,19 @@ void nano::block_processor::process_batch (std::unique_lock<std::mutex> & lock_a
}
}

void nano::block_processor::process_live (nano::block_hash const & hash_a, std::shared_ptr<nano::block> block_a)
{
// Start collecting quorum on block
node.active.start (block_a);
// Announce block contents to the network
node.network.republish_block (block_a);
if (node.config.enable_voting)
{
// Announce our weighted vote to the network
generator.add (hash_a);
}
}

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;
Expand All @@ -1637,11 +1650,7 @@ nano::process_return nano::block_processor::process_one (nano::transaction const
}
if (origination != std::chrono::steady_clock::time_point () && node.block_arrival.recent (hash))
{
node.active.start (block_a);
if (node.config.enable_voting)
{
generator.add (hash);
}
process_live (hash, block_a);
}
queue_unchecked (transaction_a, hash, origination);
break;
Expand Down
1 change: 1 addition & 0 deletions nano/node/node.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -444,6 +444,7 @@ class block_processor
void queue_unchecked (nano::transaction const &, nano::block_hash const &, std::chrono::steady_clock::time_point = std::chrono::steady_clock::time_point ());
void verify_state_blocks (nano::transaction const & transaction_a, std::unique_lock<std::mutex> &, size_t = std::numeric_limits<size_t>::max ());
void process_batch (std::unique_lock<std::mutex> &);
void process_live (nano::block_hash const &, std::shared_ptr<nano::block>);
bool stopped;
bool active;
std::chrono::steady_clock::time_point next_log;
Expand Down