Skip to content

Commit dbef244

Browse files
committed
Node: reduced logging. Task-assignment attempts are VERBOSE
Assigned tasks are DEBUG
1 parent 2bcb2d6 commit dbef244

File tree

1 file changed

+10
-9
lines changed

1 file changed

+10
-9
lines changed

node/node.cpp

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -337,17 +337,17 @@ void Node::TryAssignTask(Task& t)
337337

338338
bool Node::TryAssignTask(Task& t, Peer& p)
339339
{
340-
BEAM_LOG_DEBUG() << "Peer " << p.m_RemoteAddr << " trying to assign task " << t.m_Key.first;
340+
BEAM_LOG_VERBOSE() << "Peer " << p.m_RemoteAddr << " trying to assign task " << t.m_Key.first;
341341

342342
if (!p.ShouldAssignTasks())
343343
{
344-
BEAM_LOG_DEBUG() << "not auth";
344+
BEAM_LOG_VERBOSE() << "not auth";
345345
return false;
346346
}
347347

348348
if (p.m_Tip.m_Full.m_Number.v < t.m_Key.first.m_Number.v)
349349
{
350-
BEAM_LOG_DEBUG() << "behind";
350+
BEAM_LOG_VERBOSE() << "behind";
351351
return false;
352352
}
353353

@@ -357,7 +357,7 @@ bool Node::TryAssignTask(Task& t, Peer& p)
357357
{
358358
if (p.m_Tip.m_hh.m_Hash != t.m_Key.first.m_Hash)
359359
{
360-
BEAM_LOG_DEBUG() << "diverged";
360+
BEAM_LOG_VERBOSE() << "diverged";
361361
return false;
362362
}
363363
}
@@ -371,7 +371,7 @@ bool Node::TryAssignTask(Task& t, Peer& p)
371371

372372
if (p.m_setRejected.end() != p.m_setRejected.find(t.m_Key))
373373
{
374-
BEAM_LOG_DEBUG() << "task already rejected";
374+
BEAM_LOG_VERBOSE() << "task already rejected";
375375
return false;
376376
}
377377

@@ -388,7 +388,7 @@ bool Node::TryAssignTask(Task& t, Peer& p)
388388
{
389389
if (m_nTasksPackBody >= m_Cfg.m_MaxConcurrentBlocksRequest)
390390
{
391-
BEAM_LOG_DEBUG() << "too many blocks requested";
391+
BEAM_LOG_VERBOSE() << "too many blocks requested";
392392
return false; // too many blocks requested
393393
}
394394

@@ -431,13 +431,13 @@ bool Node::TryAssignTask(Task& t, Peer& p)
431431
const uint32_t nMaxHdrRequests = proto::g_HdrPackMaxSize * 2;
432432
if (m_nTasksPackHdr >= nMaxHdrRequests)
433433
{
434-
BEAM_LOG_DEBUG() << "too many hdrs requested";
434+
BEAM_LOG_VERBOSE() << "too many hdrs requested";
435435
return false; // too many hdrs requested
436436
}
437437

438438
if (nBlocks)
439439
{
440-
BEAM_LOG_DEBUG() << "peer busy";
440+
BEAM_LOG_VERBOSE() << "peer busy";
441441
return false; // don't requests headers from the peer that transfers a block
442442
}
443443

@@ -479,7 +479,8 @@ bool Node::TryAssignTask(Task& t, Peer& p)
479479
if (bEmpty)
480480
p.SetTimerWrtFirstTask();
481481

482-
BEAM_LOG_DEBUG() << "task assigned";
482+
BEAM_LOG_DEBUG() << "Peer " << p.m_RemoteAddr << " assigned task " << t.m_Key.first;
483+
483484
return true;
484485
}
485486

0 commit comments

Comments
 (0)