diff --git a/libraries/plugins/peerplays_sidechain/include/graphene/peerplays_sidechain/sidechain_net_handler_bitcoin.hpp b/libraries/plugins/peerplays_sidechain/include/graphene/peerplays_sidechain/sidechain_net_handler_bitcoin.hpp index 90af94e5..36bfdac1 100644 --- a/libraries/plugins/peerplays_sidechain/include/graphene/peerplays_sidechain/sidechain_net_handler_bitcoin.hpp +++ b/libraries/plugins/peerplays_sidechain/include/graphene/peerplays_sidechain/sidechain_net_handler_bitcoin.hpp @@ -22,7 +22,6 @@ public: class bitcoin_rpc_client { public: bitcoin_rpc_client(std::string _ip, uint32_t _rpc, std::string _user, std::string _password, std::string _wallet, std::string _wallet_password); - bool connection_is_not_defined() const; std::string addmultisigaddress(const std::vector public_keys); std::string createrawtransaction(const std::vector &ins, const fc::flat_map outs); @@ -59,9 +58,6 @@ private: class zmq_listener { public: zmq_listener(std::string _ip, uint32_t _zmq); - bool connection_is_not_defined() const { - return zmq_port == 0; - } fc::signal event_received; diff --git a/libraries/plugins/peerplays_sidechain/peerplays_sidechain_plugin.cpp b/libraries/plugins/peerplays_sidechain/peerplays_sidechain_plugin.cpp index e5a05e75..a7bc3783 100644 --- a/libraries/plugins/peerplays_sidechain/peerplays_sidechain_plugin.cpp +++ b/libraries/plugins/peerplays_sidechain/peerplays_sidechain_plugin.cpp @@ -289,7 +289,7 @@ void peerplays_sidechain_plugin_impl::heartbeat_loop() { for (son_id_type son_id : sons) { if (is_active_son(son_id) || get_son_object(son_id).status == chain::son_status::in_maintenance) { - ilog("peerplays_sidechain_plugin: sending heartbeat for SON ${son}", ("son", son_id)); + ilog("sending heartbeat for SON ${son}", ("son", son_id)); chain::son_heartbeat_operation op; op.owner_account = get_son_object(son_id).son_account; op.son_id = son_id; @@ -302,7 +302,7 @@ void peerplays_sidechain_plugin_impl::heartbeat_loop() { plugin.app().p2p_node()->broadcast(net::trx_message(trx)); return true; } catch (fc::exception e) { - ilog("peerplays_sidechain_plugin_impl: sending heartbeat failed with exception ${e}", ("e", e.what())); + ilog("sending heartbeat failed with exception ${e}", ("e", e.what())); return false; } }); @@ -329,7 +329,7 @@ void peerplays_sidechain_plugin_impl::son_processing() { } chain::son_id_type next_son_id = plugin.database().get_scheduled_son(1); - ilog("peerplays_sidechain_plugin_impl: Scheduled SON ${son}", ("son", next_son_id)); + ilog("Scheduled SON ${son}", ("son", next_son_id)); // Tasks that are executed by all active SONs, no matter if scheduled // E.g. sending approvals and signing @@ -355,14 +355,6 @@ void peerplays_sidechain_plugin_impl::son_processing() { } } -void peerplays_sidechain_plugin_impl::process_signing() { - net_manager->process_signing(); -} - -void peerplays_sidechain_plugin_impl::complete_signing() { - net_manager->complete_signing(); -} - void peerplays_sidechain_plugin_impl::approve_proposals() { auto approve_proposal = [&](const chain::son_id_type &son_id, const chain::proposal_id_type &proposal_id) { @@ -379,7 +371,7 @@ void peerplays_sidechain_plugin_impl::approve_proposals() { plugin.app().p2p_node()->broadcast(net::trx_message(trx)); return true; } catch (fc::exception e) { - ilog("peerplays_sidechain_plugin_impl: sending approval failed with exception ${e}", ("e", e.what())); + ilog("sending approval failed with exception ${e}", ("e", e.what())); return false; } }); @@ -497,7 +489,7 @@ void peerplays_sidechain_plugin_impl::create_son_down_proposals() { plugin.app().p2p_node()->broadcast(net::trx_message(trx)); return true; } catch (fc::exception e) { - ilog("peerplays_sidechain_plugin_impl: sending son down proposal failed with exception ${e}", ("e", e.what())); + ilog("sending son down proposal failed with exception ${e}", ("e", e.what())); return false; } }); @@ -531,7 +523,7 @@ void peerplays_sidechain_plugin_impl::create_son_deregister_proposals() { plugin.app().p2p_node()->broadcast(net::trx_message(trx)); return true; } catch (fc::exception e) { - ilog("peerplays_sidechain_plugin_impl: sending son dereg proposal failed with exception ${e}", ("e", e.what())); + ilog("sending son dereg proposal failed with exception ${e}", ("e", e.what())); return false; } }); @@ -554,6 +546,14 @@ void peerplays_sidechain_plugin_impl::process_withdrawals() { net_manager->process_withdrawals(); } +void peerplays_sidechain_plugin_impl::process_signing() { + net_manager->process_signing(); +} + +void peerplays_sidechain_plugin_impl::complete_signing() { + net_manager->complete_signing(); +} + void peerplays_sidechain_plugin_impl::on_applied_block(const signed_block &b) { schedule_son_processing(); } diff --git a/libraries/plugins/peerplays_sidechain/sidechain_net_handler_bitcoin.cpp b/libraries/plugins/peerplays_sidechain/sidechain_net_handler_bitcoin.cpp index ae124133..98201bfc 100644 --- a/libraries/plugins/peerplays_sidechain/sidechain_net_handler_bitcoin.cpp +++ b/libraries/plugins/peerplays_sidechain/sidechain_net_handler_bitcoin.cpp @@ -36,10 +36,6 @@ bitcoin_rpc_client::bitcoin_rpc_client(std::string _ip, uint32_t _rpc, std::stri authorization.val = "Basic " + fc::base64_encode(user + ":" + password); } -bool bitcoin_rpc_client::connection_is_not_defined() const { - return ip.empty() || rpc_port == 0 || user.empty() || password.empty(); -} - std::string bitcoin_rpc_client::addmultisigaddress(const std::vector public_keys) { std::string body = std::string("{\"jsonrpc\": \"1.0\", \"id\":\"addmultisigaddress\", " "\"method\": \"addmultisigaddress\", \"params\": [");