better debugging messages around crashes

This commit is contained in:
Daniel Larimer 2015-09-15 08:38:27 -04:00
parent 640d69aa05
commit f506c2b089
3 changed files with 15 additions and 3 deletions

View file

@ -621,7 +621,12 @@ namespace detail {
// returns a vector where the first element is the common ancestor with the preferred chain,
// and the last element is the reference point you passed in
assert(fork_history.size() >= 2);
assert(fork_history.back() == reference_point);
if( fork_history.back() != reference_point )
{
edump( (fork_history)(reference_point) );
assert(fork_history.back() == reference_point);
}
block_id_type last_non_fork_block = fork_history.front();
fork_history.erase(fork_history.begin()); // remove the common ancestor

View file

@ -79,7 +79,14 @@ const signed_transaction& database::get_recent_transaction(const transaction_id_
std::vector<block_id_type> database::get_block_ids_on_fork(block_id_type head_of_fork) const
{
pair<fork_database::branch_type, fork_database::branch_type> branches = _fork_db.fetch_branch_from(head_block_id(), head_of_fork);
assert(branches.first.back()->previous_id() == branches.second.back()->previous_id());
if( !((branches.first.back()->previous_id() == branches.second.back()->previous_id())) )
{
edump( (head_of_fork)
(head_block_id())
(branches.first.size())
(branches.second.size()) );
assert(branches.first.back()->previous_id() == branches.second.back()->previous_id());
}
std::vector<block_id_type> result;
for (const item_ptr& fork_block : branches.second)
result.emplace_back(fork_block->id);

View file

@ -285,7 +285,7 @@ block_production_condition::block_production_condition_enum witness_plugin::mayb
_production_skip_flags
);
capture("n", block.block_num())("t", block.timestamp)("c", now);
p2p_node().broadcast(net::block_message(block));
fc::async( [this,block](){ p2p_node().broadcast(net::block_message(block)); } );
return block_production_condition::produced;
}