Skip to content

Commit

Permalink
Fix bare numeric value for peer throttle.
Browse files Browse the repository at this point in the history
  • Loading branch information
jgiszczak committed Sep 11, 2023
1 parent 92e4022 commit b24f8e3
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion plugins/net_plugin/net_plugin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4054,7 +4054,9 @@ namespace eosio {
std::smatch units_match;
std::regex_match(units, units_match, units_regex);
try {
EOS_ASSERT(units_match.size() == 2, plugin_config_exception, "invalid block sync rate limit specification: ${limit}", ("limit", units));
if( units.length() > 0 ) {
EOS_ASSERT(units_match.size() == 2, plugin_config_exception, "invalid block sync rate limit specification: ${limit}", ("limit", units));
}
block_sync_rate_limit = boost::numeric_cast<size_t>(limit * prefix_multipliers.at(units_match[1].str()));
fc_dlog( logger, "setting block_sync_rate_limit to ${limit} bytes per second", ("limit", block_sync_rate_limit));
} catch (boost::numeric::bad_numeric_cast&) {
Expand Down

0 comments on commit b24f8e3

Please sign in to comment.