Skip to content

Commit

Permalink
REPUBLISH HASH WITH VOTES
Browse files Browse the repository at this point in the history
  • Loading branch information
pwojcikdev committed Mar 4, 2024
1 parent 5bc8038 commit 305efde
Showing 1 changed file with 24 additions and 1 deletion.
25 changes: 24 additions & 1 deletion nano/node/json_handler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3708,7 +3708,30 @@ void nano::json_handler::republish ()
}
hash = node.store.block.successor (transaction, hash);
}
node.network.flood_block_many (std::move (republish_bundle), nullptr, 25);
// node.network.flood_block_many (std::move (republish_bundle), nullptr, 25);

int num_blocks = 0;
int num_votes = 0;

for (auto const & block : republish_bundle)
{
++num_blocks;
node.network.flood_block_initial (block);

auto votes = node.vote_storage.query_hash (block->hash ());
for (auto const & vote : votes)
{
++num_votes;
node.network.flood_vote_pr (vote);
node.network.flood_vote (vote, 2.0f);
}

std::this_thread::sleep_for (std::chrono::seconds{ 1 });
}

response_l.put ("num_blocks", num_blocks);
response_l.put ("num_votes", num_votes);

response_l.put ("success", ""); // obsolete
response_l.add_child ("blocks", blocks);
}
Expand Down

0 comments on commit 305efde

Please sign in to comment.