aboutsummaryrefslogtreecommitdiff
path: root/src/crypto
diff options
context:
space:
mode:
authorRiccardo Spagni <ric@spagni.net>2017-12-17 12:59:43 +0200
committerRiccardo Spagni <ric@spagni.net>2017-12-17 12:59:44 +0200
commit066fd7aced8ff0079271bae1295355d741f2ea7b (patch)
treee8056ad1f87ed1d9fc695e68c87bb5adc2700d52 /src/crypto
parentMerge pull request #2864 (diff)
parentWallets now do not depend on the daemon rpc lib (diff)
downloadmonero-066fd7aced8ff0079271bae1295355d741f2ea7b.tar.xz
Merge pull request #2877
43f5269f Wallets now do not depend on the daemon rpc lib (moneromooo-monero) bb89ae8b move connection_basic and network_throttle from src/p2p to epee (moneromooo-monero) 4abf25f3 cryptonote_core does not depend on p2p anymore (moneromooo-monero)
Diffstat (limited to '')
-rw-r--r--src/cryptonote_core/cryptonote_core.cpp16
-rw-r--r--src/cryptonote_core/cryptonote_core.h3
-rw-r--r--src/cryptonote_protocol/cryptonote_protocol_handler-base.cpp2
-rw-r--r--src/cryptonote_protocol/cryptonote_protocol_handler.h6
-rw-r--r--src/cryptonote_protocol/cryptonote_protocol_handler.inl6
5 files changed, 10 insertions, 23 deletions
diff --git a/src/cryptonote_core/cryptonote_core.cpp b/src/cryptonote_core/cryptonote_core.cpp
index 8985c11ca..960a07832 100644
--- a/src/cryptonote_core/cryptonote_core.cpp
+++ b/src/cryptonote_core/cryptonote_core.cpp
@@ -48,11 +48,11 @@ using namespace epee;
#include "cryptonote_tx_utils.h"
#include "misc_language.h"
#include <csignal>
-#include <p2p/net_node.h>
#include "checkpoints/checkpoints.h"
#include "ringct/rctTypes.h"
#include "blockchain_db/blockchain_db.h"
#include "ringct/rctSigs.h"
+#include "version.h"
#undef MONERO_DEFAULT_LOG_CATEGORY
#define MONERO_DEFAULT_LOG_CATEGORY "cn"
@@ -236,10 +236,6 @@ namespace cryptonote
command_line::add_arg(desc, arg_test_dbg_lock_sleep);
command_line::add_arg(desc, arg_offline);
- // we now also need some of net_node's options (p2p bind arg, for separate data dir)
- command_line::add_arg(desc, nodetool::arg_testnet_p2p_bind_port, false);
- command_line::add_arg(desc, nodetool::arg_p2p_bind_port, false);
-
miner::init_options(desc);
BlockchainDB::init_options(desc);
}
@@ -338,21 +334,17 @@ namespace cryptonote
return m_blockchain_storage.get_alternative_blocks_count();
}
//-----------------------------------------------------------------------------------------------
- bool core::init(const boost::program_options::variables_map& vm, const cryptonote::test_options *test_options)
+ bool core::init(const boost::program_options::variables_map& vm, const char *config_subdir, const cryptonote::test_options *test_options)
{
start_time = std::time(nullptr);
m_fakechain = test_options != NULL;
bool r = handle_command_line(vm);
bool testnet = command_line::get_arg(vm, arg_testnet_on);
- auto p2p_bind_arg = testnet ? nodetool::arg_testnet_p2p_bind_port : nodetool::arg_p2p_bind_port;
- std::string m_port = command_line::get_arg(vm, p2p_bind_arg);
std::string m_config_folder_mempool = m_config_folder;
- if ((!testnet && m_port != std::to_string(::config::P2P_DEFAULT_PORT))
- || (testnet && m_port != std::to_string(::config::testnet::P2P_DEFAULT_PORT))) {
- m_config_folder_mempool = m_config_folder_mempool + "/" + m_port;
- }
+ if (config_subdir)
+ m_config_folder_mempool = m_config_folder_mempool + "/" + config_subdir;
std::string db_type = command_line::get_arg(vm, cryptonote::arg_db_type);
std::string db_sync_mode = command_line::get_arg(vm, cryptonote::arg_db_sync_mode);
diff --git a/src/cryptonote_core/cryptonote_core.h b/src/cryptonote_core/cryptonote_core.h
index 1b60f83f0..9f84ed303 100644
--- a/src/cryptonote_core/cryptonote_core.h
+++ b/src/cryptonote_core/cryptonote_core.h
@@ -241,11 +241,12 @@ namespace cryptonote
* a miner instance with parameters given on the command line (or defaults)
*
* @param vm command line parameters
+ * @param config_subdir subdirectory for config storage
* @param test_options configuration options for testing
*
* @return false if one of the init steps fails, otherwise true
*/
- bool init(const boost::program_options::variables_map& vm, const test_options *test_options = NULL);
+ bool init(const boost::program_options::variables_map& vm, const char *config_subdir = NULL, const test_options *test_options = NULL);
/**
* @copydoc Blockchain::reset_and_set_genesis_block
diff --git a/src/cryptonote_protocol/cryptonote_protocol_handler-base.cpp b/src/cryptonote_protocol/cryptonote_protocol_handler-base.cpp
index 094e4fc95..578abd20c 100644
--- a/src/cryptonote_protocol/cryptonote_protocol_handler-base.cpp
+++ b/src/cryptonote_protocol/cryptonote_protocol_handler-base.cpp
@@ -70,7 +70,7 @@
#include <boost/asio/ip/unicast.hpp>
#include "cryptonote_protocol_handler.h"
-#include "p2p/network_throttle.hpp"
+#include "net/network_throttle.hpp"
#include "cryptonote_core/cryptonote_core.h" // e.g. for the send_stop_signal()
diff --git a/src/cryptonote_protocol/cryptonote_protocol_handler.h b/src/cryptonote_protocol/cryptonote_protocol_handler.h
index d54687e6a..f61caf69b 100644
--- a/src/cryptonote_protocol/cryptonote_protocol_handler.h
+++ b/src/cryptonote_protocol/cryptonote_protocol_handler.h
@@ -36,7 +36,6 @@
#include <boost/program_options/variables_map.hpp>
#include <string>
-#include <ctime>
#include "math_helper.h"
#include "storages/levin_abstract_invoke2.h"
@@ -46,8 +45,6 @@
#include "block_queue.h"
#include "cryptonote_basic/connection_context.h"
#include "cryptonote_basic/cryptonote_stat_info.h"
-#include "cryptonote_basic/verification_context.h"
-// #include <netinet/in.h>
#include <boost/circular_buffer.hpp>
PUSH_WARNINGS
@@ -173,7 +170,4 @@ namespace cryptonote
} // namespace
-
-#include "cryptonote_protocol_handler.inl"
-
POP_WARNINGS
diff --git a/src/cryptonote_protocol/cryptonote_protocol_handler.inl b/src/cryptonote_protocol/cryptonote_protocol_handler.inl
index 48ab1eadf..389e8ba84 100644
--- a/src/cryptonote_protocol/cryptonote_protocol_handler.inl
+++ b/src/cryptonote_protocol/cryptonote_protocol_handler.inl
@@ -37,11 +37,11 @@
#include <boost/interprocess/detail/atomic.hpp>
#include <list>
-#include <unordered_map>
+#include <ctime>
#include "cryptonote_basic/cryptonote_format_utils.h"
#include "profile_tools.h"
-#include "p2p/network_throttle-detail.hpp"
+#include "net/network_throttle-detail.hpp"
#undef MONERO_DEFAULT_LOG_CATEGORY
#define MONERO_DEFAULT_LOG_CATEGORY "net.cn"
@@ -1561,7 +1561,7 @@ skip:
size_t t_cryptonote_protocol_handler<t_core>::get_synchronizing_connections_count()
{
size_t count = 0;
- m_p2p->for_each_connection([&](cryptonote_connection_context& context, nodetool::peerid_type peer_id)->bool{
+ m_p2p->for_each_connection([&](cryptonote_connection_context& context, nodetool::peerid_type peer_id, uint32_t support_flags)->bool{
if(context.m_state == cryptonote_connection_context::state_synchronizing)
++count;
return true;