peerplays_migrated/libraries/plugins/peerplays_sidechain/sidechain_net_manager.cpp
obucinac a688bb93ed
son_wallet_object operations and multisig wallet recreation by RPC (#263)
* Extend GPO.active_sons to contain votes and all public keys

* Introduce son_wallet_object
* son_wallet_object operations
* Create son_wallet_object on new set of SONs, to initiate primary wallet recreation
* son_wallet_object API and cli wallet commands
* Send RPC command to bitcoin node to recreate multisig wallet
* Updating wallet info through operation instead through database.modify() for persistance
* Update libraries/chain/include/graphene/chain/protocol/son_wallet.hpp
* Update libraries/chain/include/graphene/chain/protocol/son_wallet.hpp
* Fix #include <graphene/chain/son_wallet_transfer_object.hpp>
* Refactor primary wallet recreation
* PW recreation refactoring, prevent duplicated recreations, update wallet address through proposal
* Quickfix for checking payer in evaluator
* Fix failing son_wallet_tests
- Check for son_btc_account is temporarely disabled
* Remove redundant file
Co-authored-by: gladcow <jahr@yandex.ru>
2020-02-04 19:31:45 +01:00

46 lines
1.3 KiB
C++

#include <graphene/peerplays_sidechain/sidechain_net_manager.hpp>
#include <fc/log/logger.hpp>
#include <graphene/chain/son_wallet_object.hpp>
#include <graphene/peerplays_sidechain/sidechain_net_handler_bitcoin.hpp>
namespace graphene { namespace peerplays_sidechain {
sidechain_net_manager::sidechain_net_manager(peerplays_sidechain_plugin& _plugin) :
plugin(_plugin),
database(_plugin.database())
{
ilog(__FUNCTION__);
}
sidechain_net_manager::~sidechain_net_manager() {
ilog(__FUNCTION__);
}
bool sidechain_net_manager::create_handler(peerplays_sidechain::sidechain_type sidechain, const boost::program_options::variables_map& options) {
ilog(__FUNCTION__);
bool ret_val = false;
switch (sidechain) {
case sidechain_type::bitcoin: {
std::unique_ptr<sidechain_net_handler> h = std::unique_ptr<sidechain_net_handler>(new sidechain_net_handler_bitcoin(plugin, options));
net_handlers.push_back(std::move(h));
ret_val = true;
break;
}
default:
assert(false);
}
return ret_val;
}
void sidechain_net_manager::recreate_primary_wallet() {
for ( size_t i = 0; i < net_handlers.size(); i++ ) {
net_handlers.at(i)->recreate_primary_wallet();
}
}
} } // graphene::peerplays_sidechain