mirror of
https://github.com/monero-project/monero.git
synced 2025-08-05 08:14:25 -04:00
Separate testnet address prefix
This commit is contained in:
parent
ee1bacc64f
commit
d03308734b
21 changed files with 126 additions and 69 deletions
|
@ -218,10 +218,10 @@ int main(int argc, char* argv[])
|
|||
cprotocol
|
||||
, testnet_mode ? std::move(config::testnet::NETWORK_ID) : std::move(config::NETWORK_ID)
|
||||
};
|
||||
cryptonote::core_rpc_server rpc_server(ccore, p2psrv);
|
||||
cryptonote::core_rpc_server rpc_server {ccore, p2psrv, testnet_mode};
|
||||
cprotocol.set_p2p_endpoint(&p2psrv);
|
||||
ccore.set_cryptonote_protocol(&cprotocol);
|
||||
daemon_cmmands_handler dch(p2psrv);
|
||||
daemon_cmmands_handler dch(p2psrv, testnet_mode);
|
||||
|
||||
//initialize objects
|
||||
LOG_PRINT_L0("Initializing P2P server...");
|
||||
|
@ -235,7 +235,7 @@ int main(int argc, char* argv[])
|
|||
LOG_PRINT_L0("Protocol initialized OK");
|
||||
|
||||
LOG_PRINT_L0("Initializing core RPC server...");
|
||||
res = rpc_server.init(vm, testnet_mode);
|
||||
res = rpc_server.init(vm);
|
||||
CHECK_AND_ASSERT_MES(res, 1, "Failed to initialize core RPC server.");
|
||||
LOG_PRINT_GREEN("Core RPC server initialized OK on port: " << rpc_server.get_binded_port(), LOG_LEVEL_0);
|
||||
|
||||
|
|
|
@ -50,7 +50,12 @@ class daemon_cmmands_handler
|
|||
{
|
||||
nodetool::node_server<cryptonote::t_cryptonote_protocol_handler<cryptonote::core> >& m_srv;
|
||||
public:
|
||||
daemon_cmmands_handler(nodetool::node_server<cryptonote::t_cryptonote_protocol_handler<cryptonote::core> >& srv):m_srv(srv)
|
||||
daemon_cmmands_handler(
|
||||
nodetool::node_server<cryptonote::t_cryptonote_protocol_handler<cryptonote::core> >& srv
|
||||
, bool testnet
|
||||
)
|
||||
: m_srv(srv)
|
||||
, m_testnet {testnet}
|
||||
{
|
||||
m_cmd_binder.set_handler("help", boost::bind(&daemon_cmmands_handler::help, this, _1), "Show this help");
|
||||
m_cmd_binder.set_handler("print_pl", boost::bind(&daemon_cmmands_handler::print_pl, this, _1), "Print peer list");
|
||||
|
@ -84,6 +89,7 @@ public:
|
|||
|
||||
private:
|
||||
epee::srv_console_handlers_binder<nodetool::node_server<cryptonote::t_cryptonote_protocol_handler<cryptonote::core> > > m_cmd_binder;
|
||||
bool m_testnet;
|
||||
|
||||
//--------------------------------------------------------------------------------
|
||||
std::string get_commands_str()
|
||||
|
@ -368,7 +374,7 @@ private:
|
|||
}
|
||||
|
||||
cryptonote::account_public_address adr;
|
||||
if(!cryptonote::get_account_address_from_str(adr, args.front()))
|
||||
if(!cryptonote::get_account_address_from_str(adr, m_testnet, args.front()))
|
||||
{
|
||||
std::cout << "target account address has wrong format" << std::endl;
|
||||
return true;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue