Merge pull request #535

cb4ee1b Tone down L0 logs during daemon sync some more (moneromooo-monero)
2177923 Tone down a bit L0 logs during daemon sync (moneromooo-monero)
This commit is contained in:
Riccardo Spagni 2015-12-15 15:21:58 +02:00
commit ba7a01646d
No known key found for this signature in database
GPG Key ID: 55432DF31CCD4FCD
4 changed files with 15 additions and 6 deletions

View File

@ -2900,7 +2900,7 @@ bool Blockchain::prepare_handle_incoming_blocks(const std::list<block_complete_e
crypto::hash tophash = m_db->top_block_hash(); crypto::hash tophash = m_db->top_block_hash();
if (block.prev_id != tophash) if (block.prev_id != tophash)
{ {
LOG_PRINT_L0("Skipping prepare blocks. New blocks don't belong to chain.") LOG_PRINT_L1("Skipping prepare blocks. New blocks don't belong to chain.")
return true; return true;
} }
} }

View File

@ -122,7 +122,7 @@ cryptonote_protocol_handler_base::~cryptonote_protocol_handler_base() {
void cryptonote_protocol_handler_base::handler_request_blocks_history(std::list<crypto::hash>& ids) { void cryptonote_protocol_handler_base::handler_request_blocks_history(std::list<crypto::hash>& ids) {
using namespace epee::net_utils; using namespace epee::net_utils;
LOG_PRINT_L0("### ~~~RRRR~~~~ ### sending request (type 2), limit = " << ids.size()); LOG_PRINT_L1("### ~~~RRRR~~~~ ### sending request (type 2), limit = " << ids.size());
LOG_PRINT_RED("RATE LIMIT NOT IMPLEMENTED HERE YET (download at unlimited speed?)" , LOG_LEVEL_0); LOG_PRINT_RED("RATE LIMIT NOT IMPLEMENTED HERE YET (download at unlimited speed?)" , LOG_LEVEL_0);
_note_c("net/req2", "### ~~~RRRR~~~~ ### sending request (type 2), limit = " << ids.size()); _note_c("net/req2", "### ~~~RRRR~~~~ ### sending request (type 2), limit = " << ids.size());
// TODO // TODO

View File

@ -536,10 +536,12 @@ namespace cryptonote
epee::misc_utils::auto_scope_leave_caller scope_exit_handler = epee::misc_utils::create_scope_leave_handler( epee::misc_utils::auto_scope_leave_caller scope_exit_handler = epee::misc_utils::create_scope_leave_handler(
boost::bind(&t_core::resume_mine, &m_core)); boost::bind(&t_core::resume_mine, &m_core));
LOG_PRINT_CCONTEXT_YELLOW( "Got NEW BLOCKS inside of " << __FUNCTION__ << ": size: " << arg.blocks.size() , LOG_LEVEL_0); LOG_PRINT_CCONTEXT_YELLOW( "Got NEW BLOCKS inside of " << __FUNCTION__ << ": size: " << arg.blocks.size() , LOG_LEVEL_1);
if (m_core.get_test_drop_download() && m_core.get_test_drop_download_height()) { // DISCARD BLOCKS for testing if (m_core.get_test_drop_download() && m_core.get_test_drop_download_height()) { // DISCARD BLOCKS for testing
uint64_t previous_height = m_core.get_current_blockchain_height();
m_core.prepare_handle_incoming_blocks(arg.blocks); m_core.prepare_handle_incoming_blocks(arg.blocks);
BOOST_FOREACH(const block_complete_entry& block_entry, arg.blocks) BOOST_FOREACH(const block_complete_entry& block_entry, arg.blocks)
{ {
@ -590,8 +592,14 @@ namespace cryptonote
epee::net_utils::data_logger::get_instance().add_data("calc_time", block_process_time + transactions_process_time); epee::net_utils::data_logger::get_instance().add_data("calc_time", block_process_time + transactions_process_time);
epee::net_utils::data_logger::get_instance().add_data("block_processing", 1); epee::net_utils::data_logger::get_instance().add_data("block_processing", 1);
} // each download block } // each download block
m_core.cleanup_handle_incoming_blocks(); m_core.cleanup_handle_incoming_blocks();
if (m_core.get_current_blockchain_height() > previous_height)
{
LOG_PRINT_CCONTEXT_YELLOW( "Synced " << m_core.get_current_blockchain_height() << "/" << m_core.get_target_blockchain_height() , LOG_LEVEL_0);
}
} // if not DISCARD BLOCK } // if not DISCARD BLOCK
@ -652,7 +660,7 @@ namespace cryptonote
} }
context.m_needed_objects.erase(it++); context.m_needed_objects.erase(it++);
} }
LOG_PRINT_CCONTEXT_L0("-->>NOTIFY_REQUEST_GET_OBJECTS: blocks.size()=" << req.blocks.size() << ", txs.size()=" << req.txs.size() LOG_PRINT_CCONTEXT_L1("-->>NOTIFY_REQUEST_GET_OBJECTS: blocks.size()=" << req.blocks.size() << ", txs.size()=" << req.txs.size()
<< "requested blocks count=" << count << " / " << count_limit); << "requested blocks count=" << count << " / " << count_limit);
//epee::net_utils::network_throttle_manager::get_global_throttle_inreq().logger_handle_net("log/dr-monero/net/req-all.data", sec, get_avg_block_size()); //epee::net_utils::network_throttle_manager::get_global_throttle_inreq().logger_handle_net("log/dr-monero/net/req-all.data", sec, get_avg_block_size());
@ -667,9 +675,9 @@ namespace cryptonote
//std::string blob; // for calculate size of request //std::string blob; // for calculate size of request
//epee::serialization::store_t_to_binary(r, blob); //epee::serialization::store_t_to_binary(r, blob);
//epee::net_utils::network_throttle_manager::get_global_throttle_inreq().logger_handle_net("log/dr-monero/net/req-all.data", sec, get_avg_block_size()); //epee::net_utils::network_throttle_manager::get_global_throttle_inreq().logger_handle_net("log/dr-monero/net/req-all.data", sec, get_avg_block_size());
LOG_PRINT_CCONTEXT_L0("r = " << 200); LOG_PRINT_CCONTEXT_L1("r = " << 200);
LOG_PRINT_CCONTEXT_L0("-->>NOTIFY_REQUEST_CHAIN: m_block_ids.size()=" << r.block_ids.size() ); LOG_PRINT_CCONTEXT_L1("-->>NOTIFY_REQUEST_CHAIN: m_block_ids.size()=" << r.block_ids.size() );
post_notify<NOTIFY_REQUEST_CHAIN>(r, context); post_notify<NOTIFY_REQUEST_CHAIN>(r, context);
}else }else
{ {

View File

@ -87,5 +87,6 @@ namespace tests
bool get_test_drop_download_height() {return true;} bool get_test_drop_download_height() {return true;}
bool prepare_handle_incoming_blocks(const std::list<cryptonote::block_complete_entry> &blocks) { return true; } bool prepare_handle_incoming_blocks(const std::list<cryptonote::block_complete_entry> &blocks) { return true; }
bool cleanup_handle_incoming_blocks(bool force_sync = false) { return true; } bool cleanup_handle_incoming_blocks(bool force_sync = false) { return true; }
uint64_t get_target_blockchain_height() const { return 1; }
}; };
} }