Skip to content

Commit

Permalink
Cached work was being calculated for incorrect block.
Browse files Browse the repository at this point in the history
  • Loading branch information
clemahieu committed Jan 18, 2015
1 parent cbc9748 commit f9c2a8a
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 8 deletions.
2 changes: 1 addition & 1 deletion rai/core_test/ledger.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1896,5 +1896,5 @@ TEST (ledger, latest_root)
send.hashables.balance = 1;
rai::sign_message (rai::test_genesis_key.prv, rai::test_genesis_key.pub, send.hash (), send.signature);
ASSERT_EQ (rai::process_result::progress, ledger.process (send));
ASSERT_EQ (hash1, ledger.latest_root (rai::test_genesis_key.pub));
ASSERT_EQ (send.hash (), ledger.latest_root (rai::test_genesis_key.pub));
}
5 changes: 1 addition & 4 deletions rai/node.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3974,10 +3974,7 @@ void rai::network::send_complete (boost::system::error_code const & ec, size_t s
auto & front (sends.front ());
if (network_packet_logging ())
{
if (network_packet_logging ())
{
BOOST_LOG (node.log) << "Sending packet";
}
BOOST_LOG (node.log) << "Sending packet";
}
socket.async_send_to (boost::asio::buffer (std::get <0> (front), std::get <1> (front)), std::get <2> (front), [this] (boost::system::error_code const & ec, size_t size_a)
{
Expand Down
5 changes: 2 additions & 3 deletions rai/secure.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -440,6 +440,7 @@ uint64_t rai::send_block::block_work () const

void rai::send_block::block_work_set (uint64_t work_a)
{
assert (!rai::work_validate (root (), work_a));
work = work_a;
}

Expand Down Expand Up @@ -2831,9 +2832,7 @@ rai::block_hash rai::ledger::latest_root (rai::account const & account_a)
}
else
{
auto block (store.block_get (frontier.hash));
assert (block != nullptr);
result = block->root ();
result = frontier.hash;
}
return result;
}
Expand Down

0 comments on commit f9c2a8a

Please sign in to comment.