mirror of
https://github.com/monero-project/monero.git
synced 2024-10-01 11:49:47 -04:00
Merge pull request #2587
cba34494
rpc: out_peers now works again (moneromooo-monero)
This commit is contained in:
commit
3eac7ab94f
@ -1596,21 +1596,13 @@ namespace cryptonote
|
|||||||
//------------------------------------------------------------------------------------------------------------------------------
|
//------------------------------------------------------------------------------------------------------------------------------
|
||||||
bool core_rpc_server::on_out_peers(const COMMAND_RPC_OUT_PEERS::request& req, COMMAND_RPC_OUT_PEERS::response& res)
|
bool core_rpc_server::on_out_peers(const COMMAND_RPC_OUT_PEERS::request& req, COMMAND_RPC_OUT_PEERS::response& res)
|
||||||
{
|
{
|
||||||
// TODO
|
size_t n_connections = m_p2p.get_outgoing_connections_count();
|
||||||
/*if (m_p2p.get_outgoing_connections_count() > req.out_peers)
|
size_t n_delete = (n_connections > req.out_peers) ? n_connections - req.out_peers : 0;
|
||||||
{
|
m_p2p.m_config.m_net_config.connections_count = req.out_peers;
|
||||||
m_p2p.m_config.m_net_config.connections_count = req.out_peers;
|
if (n_delete)
|
||||||
if (m_p2p.get_outgoing_connections_count() > req.out_peers)
|
m_p2p.delete_connections(n_delete);
|
||||||
{
|
res.status = CORE_RPC_STATUS_OK;
|
||||||
int count = m_p2p.get_outgoing_connections_count() - req.out_peers;
|
return true;
|
||||||
m_p2p.delete_connections(count);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
else
|
|
||||||
m_p2p.m_config.m_net_config.connections_count = req.out_peers;
|
|
||||||
*/
|
|
||||||
return true;
|
|
||||||
}
|
}
|
||||||
//------------------------------------------------------------------------------------------------------------------------------
|
//------------------------------------------------------------------------------------------------------------------------------
|
||||||
bool core_rpc_server::on_start_save_graph(const COMMAND_RPC_START_SAVE_GRAPH::request& req, COMMAND_RPC_START_SAVE_GRAPH::response& res)
|
bool core_rpc_server::on_start_save_graph(const COMMAND_RPC_START_SAVE_GRAPH::request& req, COMMAND_RPC_START_SAVE_GRAPH::response& res)
|
||||||
|
Loading…
Reference in New Issue
Block a user