Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Logging changes #40

Merged
merged 1 commit into from
Jan 30, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 8 additions & 8 deletions src/P2p/NetNode.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -596,12 +596,12 @@ namespace CryptoNote
context.version = rsp.node_data.version;

if (rsp.node_data.network_id != m_network_id) {
logger(Logging::ERROR) << context << "COMMAND_HANDSHAKE Failed, wrong network! (" << rsp.node_data.network_id << "), closing connection.";
logger(Logging::DEBUGGING) << context << "COMMAND_HANDSHAKE Failed, wrong network! (" << rsp.node_data.network_id << "), closing connection.";
return false;
}

if (!handle_remote_peerlist(rsp.local_peerlist, rsp.node_data.local_time, context)) {
logger(Logging::ERROR) << context << "COMMAND_HANDSHAKE: failed to handle_remote_peerlist(...), closing connection.";
logger(Logging::DEBUGGING) << context << "COMMAND_HANDSHAKE: failed to handle_remote_peerlist(...), closing connection.";
return false;
}

Expand All @@ -610,7 +610,7 @@ namespace CryptoNote
}

if (!m_payload_handler.process_payload_sync_data(rsp.payload_data, context, true)) {
logger(Logging::ERROR) << context << "COMMAND_HANDSHAKE invoked, but process_payload_sync_data returned false, dropping connection.";
logger(Logging::DEBUGGING) << context << "COMMAND_HANDSHAKE invoked, but process_payload_sync_data returned false, dropping connection.";
return false;
}

Expand Down Expand Up @@ -945,7 +945,7 @@ namespace CryptoNote
{
if(be.last_seen > uint64_t(local_time))
{
logger(ERROR) << "FOUND FUTURE peerlist for entry " << be.adr << " last_seen: " << be.last_seen << ", local_time(on remote node):" << local_time;
logger(DEBUGGING) << "FOUND FUTURE peerlist for entry " << be.adr << " last_seen: " << be.last_seen << ", local_time(on remote node):" << local_time;
return false;
}
be.last_seen += delta;
Expand Down Expand Up @@ -1137,7 +1137,7 @@ namespace CryptoNote
int NodeServer::handle_timed_sync(int command, COMMAND_TIMED_SYNC::request& arg, COMMAND_TIMED_SYNC::response& rsp, P2pConnectionContext& context)
{
if(!m_payload_handler.process_payload_sync_data(arg.payload_data, context, false)) {
logger(Logging::ERROR) << context << "Failed to process_payload_sync_data(), dropping connection";
logger(Logging::DEBUGGING) << context << "Failed to process_payload_sync_data(), dropping connection";
context.m_state = CryptoNoteConnectionContext::state_shutdown;
return 1;
}
Expand All @@ -1162,19 +1162,19 @@ namespace CryptoNote
}

if(!context.m_is_income) {
logger(Logging::ERROR) << context << "COMMAND_HANDSHAKE came not from incoming connection";
logger(Logging::DEBUGGING) << context << "COMMAND_HANDSHAKE came not from incoming connection";
context.m_state = CryptoNoteConnectionContext::state_shutdown;
return 1;
}

if(context.peerId) {
logger(Logging::ERROR) << context << "COMMAND_HANDSHAKE came, but seems that connection already have associated peer_id (double COMMAND_HANDSHAKE?)";
logger(Logging::DEBUGGING) << context << "COMMAND_HANDSHAKE came, but seems that connection already have associated peer_id (double COMMAND_HANDSHAKE?)";
context.m_state = CryptoNoteConnectionContext::state_shutdown;
return 1;
}

if(!m_payload_handler.process_payload_sync_data(arg.payload_data, context, true)) {
logger(Logging::ERROR) << context << "COMMAND_HANDSHAKE came, but process_payload_sync_data returned false, dropping connection.";
logger(Logging::DEBUGGING) << context << "COMMAND_HANDSHAKE came, but process_payload_sync_data returned false, dropping connection.";
context.m_state = CryptoNoteConnectionContext::state_shutdown;
return 1;
}
Expand Down