From 58ad814bc74992153e668ed6911c72f4a214d700 Mon Sep 17 00:00:00 2001 From: Alfredo Date: Sun, 18 Nov 2018 11:05:18 -0300 Subject: [PATCH] remove not needed check --- programs/witness_node/main.cpp | 23 ++++++++++------------- 1 file changed, 10 insertions(+), 13 deletions(-) diff --git a/programs/witness_node/main.cpp b/programs/witness_node/main.cpp index f0fd5da66a..336639b1ba 100644 --- a/programs/witness_node/main.cpp +++ b/programs/witness_node/main.cpp @@ -97,22 +97,19 @@ int main(int argc, char** argv) { return 1; } - if (options.count("plugins")) { + std::set plugins; + boost::split(plugins, options.at("plugins").as(), [](char c){return c == ' ';}); - std::set plugins; - boost::split(plugins, options.at("plugins").as(), [](char c){return c == ' ';}); + if(plugins.count("account_history") && plugins.count("elasticsearch")) { + std::cerr << "Plugin conflict: Cannot load both account_history plugin and elasticsearch plugin\n"; + return 1; + } - if(plugins.count("account_history") && plugins.count("elasticsearch")) { - std::cerr << "Plugin conflict: Cannot load both account_history plugin and elasticsearch plugin\n"; - return 1; + std::for_each(plugins.begin(), plugins.end(), [node](const std::string& plug) mutable { + if (!plug.empty()) { + node->enable_plugin(plug); } - - std::for_each(plugins.begin(), plugins.end(), [node](const std::string& plug) mutable { - if (!plug.empty()) { - node->enable_plugin(plug); - } - }); - } + }); if( options.count("help") ) {