Add vote status stats even when vote logging is off (#1261)
This commit is contained in:
parent
051df7be9b
commit
3f7d2191bd
1 changed files with 16 additions and 16 deletions
|
@ -1418,24 +1418,24 @@ rai::vote_code rai::vote_processor::vote_blocking (rai::transaction const & tran
|
|||
break;
|
||||
}
|
||||
}
|
||||
std::string status;
|
||||
switch (result)
|
||||
{
|
||||
case rai::vote_code::invalid:
|
||||
status = "Invalid";
|
||||
node.stats.inc (rai::stat::type::vote, rai::stat::detail::vote_invalid);
|
||||
break;
|
||||
case rai::vote_code::replay:
|
||||
status = "Replay";
|
||||
node.stats.inc (rai::stat::type::vote, rai::stat::detail::vote_replay);
|
||||
break;
|
||||
case rai::vote_code::vote:
|
||||
status = "Vote";
|
||||
node.stats.inc (rai::stat::type::vote, rai::stat::detail::vote_valid);
|
||||
break;
|
||||
}
|
||||
if (node.config.logging.vote_logging ())
|
||||
{
|
||||
char const * status;
|
||||
switch (result)
|
||||
{
|
||||
case rai::vote_code::invalid:
|
||||
status = "Invalid";
|
||||
node.stats.inc (rai::stat::type::vote, rai::stat::detail::vote_invalid);
|
||||
break;
|
||||
case rai::vote_code::replay:
|
||||
status = "Replay";
|
||||
node.stats.inc (rai::stat::type::vote, rai::stat::detail::vote_replay);
|
||||
break;
|
||||
case rai::vote_code::vote:
|
||||
status = "Vote";
|
||||
node.stats.inc (rai::stat::type::vote, rai::stat::detail::vote_valid);
|
||||
break;
|
||||
}
|
||||
BOOST_LOG (node.log) << boost::str (boost::format ("Vote from: %1% sequence: %2% block(s): %3%status: %4%") % vote_a->account.to_account () % std::to_string (vote_a->sequence) % vote_a->hashes_string () % status);
|
||||
}
|
||||
return result;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue