From f7f7669e025c91e33921c45ffa199da55a6a86aa Mon Sep 17 00:00:00 2001 From: Srdjan Obucina Date: Fri, 6 Sep 2019 16:43:24 +0200 Subject: [PATCH] add is_plugin_enabled to application --- libraries/app/application.cpp | 7 +++++++ libraries/app/include/graphene/app/application.hpp | 5 ++++- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/libraries/app/application.cpp b/libraries/app/application.cpp index 45b8e66b..b5f2f0da 100644 --- a/libraries/app/application.cpp +++ b/libraries/app/application.cpp @@ -1046,6 +1046,13 @@ std::shared_ptr application::get_plugin(const string& name) con return my->_active_plugins[name]; } +bool application::is_plugin_enabled(const string& name) const +{ + if(my->_active_plugins.find(name) == my->_active_plugins.end()) + return false; + return true; +} + net::node_ptr application::p2p_node() { return my->_p2p_network; diff --git a/libraries/app/include/graphene/app/application.hpp b/libraries/app/include/graphene/app/application.hpp index 4bee77b4..b0ace3d7 100644 --- a/libraries/app/include/graphene/app/application.hpp +++ b/libraries/app/include/graphene/app/application.hpp @@ -95,8 +95,11 @@ namespace graphene { namespace app { /// Emitted when syncing finishes (is_finished_syncing will return true) boost::signals2::signal syncing_finished; - private: void enable_plugin( const string& name ); + + bool is_plugin_enabled(const string& name) const; + + private: void add_available_plugin( std::shared_ptr p ); std::shared_ptr my;