aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authormoneromooo-monero <moneromooo-monero@users.noreply.github.com>2018-01-25 13:35:17 +0000
committermoneromooo-monero <moneromooo-monero@users.noreply.github.com>2018-01-25 13:35:58 +0000
commite3f0980a1dc2608beee73086d2581d51f367b8b8 (patch)
tree32eed0caa010dcd16186757e8e311a4e06ce855c /src
parentMerge pull request #3115 (diff)
downloadmonero-e3f0980a1dc2608beee73086d2581d51f367b8b8.tar.xz
daemon: don't drop RPC with busy error when running offline
Diffstat (limited to 'src')
-rw-r--r--src/cryptonote_protocol/cryptonote_protocol_handler.h2
-rw-r--r--src/cryptonote_protocol/cryptonote_protocol_handler.inl4
-rw-r--r--src/daemon/daemon.cpp2
-rw-r--r--src/daemon/protocol.h4
4 files changed, 6 insertions, 6 deletions
diff --git a/src/cryptonote_protocol/cryptonote_protocol_handler.h b/src/cryptonote_protocol/cryptonote_protocol_handler.h
index f61caf69b..0c9f32248 100644
--- a/src/cryptonote_protocol/cryptonote_protocol_handler.h
+++ b/src/cryptonote_protocol/cryptonote_protocol_handler.h
@@ -79,7 +79,7 @@ namespace cryptonote
typedef t_cryptonote_protocol_handler<t_core> cryptonote_protocol_handler;
typedef CORE_SYNC_DATA payload_type;
- t_cryptonote_protocol_handler(t_core& rcore, nodetool::i_p2p_endpoint<connection_context>* p_net_layout);
+ t_cryptonote_protocol_handler(t_core& rcore, nodetool::i_p2p_endpoint<connection_context>* p_net_layout, bool offline = false);
BEGIN_INVOKE_MAP2(cryptonote_protocol_handler)
HANDLE_NOTIFY_T2(NOTIFY_NEW_BLOCK, &cryptonote_protocol_handler::handle_notify_new_block)
diff --git a/src/cryptonote_protocol/cryptonote_protocol_handler.inl b/src/cryptonote_protocol/cryptonote_protocol_handler.inl
index 5d25d1058..cc1590bb1 100644
--- a/src/cryptonote_protocol/cryptonote_protocol_handler.inl
+++ b/src/cryptonote_protocol/cryptonote_protocol_handler.inl
@@ -61,10 +61,10 @@ namespace cryptonote
//-----------------------------------------------------------------------------------------------------------------------
template<class t_core>
- t_cryptonote_protocol_handler<t_core>::t_cryptonote_protocol_handler(t_core& rcore, nodetool::i_p2p_endpoint<connection_context>* p_net_layout):m_core(rcore),
+ t_cryptonote_protocol_handler<t_core>::t_cryptonote_protocol_handler(t_core& rcore, nodetool::i_p2p_endpoint<connection_context>* p_net_layout, bool offline):m_core(rcore),
m_p2p(p_net_layout),
m_syncronized_connections_count(0),
- m_synchronized(false),
+ m_synchronized(offline),
m_stopping(false)
{
diff --git a/src/daemon/daemon.cpp b/src/daemon/daemon.cpp
index 55d868a3c..31fe8e5a2 100644
--- a/src/daemon/daemon.cpp
+++ b/src/daemon/daemon.cpp
@@ -68,7 +68,7 @@ public:
boost::program_options::variables_map const & vm
)
: core{vm}
- , protocol{vm, core}
+ , protocol{vm, core, command_line::get_arg(vm, cryptonote::arg_offline)}
, p2p{vm, protocol}
{
// Handle circular dependencies
diff --git a/src/daemon/protocol.h b/src/daemon/protocol.h
index 01de535d5..c550271be 100644
--- a/src/daemon/protocol.h
+++ b/src/daemon/protocol.h
@@ -46,9 +46,9 @@ private:
public:
t_protocol(
boost::program_options::variables_map const & vm
- , t_core & core
+ , t_core & core, bool offline = false
)
- : m_protocol{core.get(), nullptr}
+ : m_protocol{core.get(), nullptr, offline}
{
MGINFO("Initializing cryptonote protocol...");
if (!m_protocol.init(vm))