Fix Witness/Sons multiple IDs reading from config file
- Reading witness-ids, son-ids properties crashed in Release build
This commit is contained in:
parent
99c8c2dd51
commit
2eea4676b2
2 changed files with 8 additions and 4 deletions
|
|
@ -138,8 +138,10 @@ void peerplays_sidechain_plugin_impl::plugin_initialize(const boost::program_opt
|
|||
config_ready_son = (options.count("son-id") || options.count("son-ids")) && options.count("peerplays-private-key");
|
||||
if (config_ready_son) {
|
||||
LOAD_VALUE_SET(options, "son-id", sons, chain::son_id_type)
|
||||
if (options.count("son-ids"))
|
||||
boost::insert(sons, fc::json::from_string(options.at("son-ids").as<string>()).as<vector<chain::son_id_type>>(5));
|
||||
if (options.count("son-ids")) {
|
||||
vector<chain::son_id_type> v = fc::json::from_string(options.at("son-ids").as<string>()).as<vector<chain::son_id_type>>(5);
|
||||
sons.insert(v.begin(), v.end());
|
||||
}
|
||||
config_ready_son = config_ready_son && !sons.empty();
|
||||
|
||||
#ifndef ENABLE_MULTIPLE_SONS
|
||||
|
|
|
|||
|
|
@ -91,8 +91,10 @@ void witness_plugin::plugin_initialize(const boost::program_options::variables_m
|
|||
ilog("witness plugin: plugin_initialize() begin");
|
||||
_options = &options;
|
||||
LOAD_VALUE_SET(options, "witness-id", _witnesses, chain::witness_id_type)
|
||||
if (options.count("witness-ids"))
|
||||
boost::insert(_witnesses, fc::json::from_string(options.at("witness-ids").as<string>()).as<vector<chain::witness_id_type>>( 5 ));
|
||||
if (options.count("witness-ids")) {
|
||||
vector<chain::witness_id_type> v = fc::json::from_string(options.at("witness-ids").as<string>()).as<vector<chain::witness_id_type>>( 5 );
|
||||
_witnesses.insert(v.begin(), v.end());
|
||||
}
|
||||
|
||||
if( options.count("private-key") )
|
||||
{
|
||||
|
|
|
|||
Loading…
Reference in a new issue