From 75626254fa17359efc1391fda70138c76adedc60 Mon Sep 17 00:00:00 2001 From: Srdjan Obucina Date: Tue, 11 Feb 2020 16:56:05 +0100 Subject: [PATCH] Add cmake command line option SUPPORT_MULTIPLE_SONS --- libraries/plugins/peerplays_sidechain/CMakeLists.txt | 7 +++++++ .../peerplays_sidechain/peerplays_sidechain_plugin.cpp | 4 ++++ 2 files changed, 11 insertions(+) diff --git a/libraries/plugins/peerplays_sidechain/CMakeLists.txt b/libraries/plugins/peerplays_sidechain/CMakeLists.txt index 4941ce51..6a6faf16 100644 --- a/libraries/plugins/peerplays_sidechain/CMakeLists.txt +++ b/libraries/plugins/peerplays_sidechain/CMakeLists.txt @@ -7,6 +7,13 @@ add_library( peerplays_sidechain sidechain_net_handler_bitcoin.cpp ) +if (SUPPORT_MULTIPLE_SONS) + message ("Multiple SONs per software instance are supported") + target_compile_definitions(peerplays_sidechain PRIVATE SUPPORT_MULTIPLE_SONS) +endif() +unset(SUPPORT_MULTIPLE_SONS) +unset(SUPPORT_MULTIPLE_SONS CACHE) + target_link_libraries( peerplays_sidechain graphene_chain graphene_app fc zmq ) target_include_directories( peerplays_sidechain PUBLIC "${CMAKE_CURRENT_SOURCE_DIR}/include" ) diff --git a/libraries/plugins/peerplays_sidechain/peerplays_sidechain_plugin.cpp b/libraries/plugins/peerplays_sidechain/peerplays_sidechain_plugin.cpp index a23e48bc..a32d9dd8 100644 --- a/libraries/plugins/peerplays_sidechain/peerplays_sidechain_plugin.cpp +++ b/libraries/plugins/peerplays_sidechain/peerplays_sidechain_plugin.cpp @@ -119,6 +119,10 @@ void peerplays_sidechain_plugin_impl::plugin_initialize(const boost::program_opt boost::insert(_sons, fc::json::from_string(options.at("son-ids").as()).as>( 5 )); config_ready_son = config_ready_son && !_sons.empty(); +#ifndef SUPPORT_MULTIPLE_SONS + FC_ASSERT( _sons.size() == 1, "Multiple SONs not supported" ); +#endif + if( options.count("peerplays-private-key") ) { const std::vector key_id_to_wif_pair_strings = options["peerplays-private-key"].as>();