Skip to content

Commit 0011d5f

Browse files
committed
Fix #367 - use unique options list for parsing config file
1 parent a4e4257 commit 0011d5f

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

programs/witness_node/main.cpp

+11-1
Original file line numberDiff line numberDiff line change
@@ -111,8 +111,18 @@ int main(int argc, char** argv) {
111111
fc::path config_ini_path = data_dir / "config.ini";
112112
if( fc::exists(config_ini_path) )
113113
{
114+
boost::container::flat_set<std::string> seen;
115+
bpo::options_description unique_options("Graphene Witness Node");
116+
for( const boost::shared_ptr<bpo::option_description> od : cfg_options.options() )
117+
{
118+
const std::string name = od->long_name();
119+
if( seen.find(name) != seen.end() ) continue;
120+
seen.insert(name);
121+
unique_options.add( od );
122+
}
123+
114124
// get the basic options
115-
bpo::store(bpo::parse_config_file<char>(config_ini_path.preferred_string().c_str(), cfg_options, true), options);
125+
bpo::store(bpo::parse_config_file<char>(config_ini_path.preferred_string().c_str(), unique_options, true), options);
116126

117127
// try to get logging options from the config file.
118128
try

0 commit comments

Comments
 (0)