diff --git a/src/logging.h b/src/logging.h --- a/src/logging.h +++ b/src/logging.h @@ -57,6 +57,7 @@ QT = (1 << 19), LEVELDB = (1 << 20), VALIDATION = (1 << 21), + AVALANCHE = (1 << 22), ALL = ~uint32_t(0), }; diff --git a/src/logging.cpp b/src/logging.cpp --- a/src/logging.cpp +++ b/src/logging.cpp @@ -121,6 +121,7 @@ {BCLog::QT, "qt"}, {BCLog::LEVELDB, "leveldb"}, {BCLog::VALIDATION, "validation"}, + {BCLog::AVALANCHE, "avalanche"}, {BCLog::ALL, "1"}, {BCLog::ALL, "all"}, }; diff --git a/src/net_processing.cpp b/src/net_processing.cpp --- a/src/net_processing.cpp +++ b/src/net_processing.cpp @@ -2815,7 +2815,7 @@ if (IsAvalancheMessageType(msg_type)) { if (!g_avalanche) { - LogPrint(BCLog::NET, + LogPrint(BCLog::AVALANCHE, "Avalanche is not initialized, ignoring %s message\n", msg_type); return; @@ -3058,7 +3058,7 @@ if ((pfrom.nServices & NODE_AVALANCHE) && g_avalanche && isAvalancheEnabled(gArgs)) { if (g_avalanche->sendHello(&pfrom)) { - LogPrint(BCLog::NET, "Send avahello to peer %d\n", + LogPrint(BCLog::AVALANCHE, "Send avahello to peer %d\n", pfrom.GetId()); auto localProof = g_avalanche->getLocalProof(); @@ -4217,7 +4217,7 @@ std::vector votes; votes.reserve(nCount); - LogPrint(BCLog::NET, "received avalanche poll from peer=%d\n", + LogPrint(BCLog::AVALANCHE, "received avalanche poll from peer=%d\n", pfrom.GetId()); { @@ -4321,8 +4321,9 @@ switch (u.getStatus()) { case avalanche::BlockUpdate::Status::Invalid: case avalanche::BlockUpdate::Status::Rejected: { - LogPrintf("Avalanche rejected %s, parking\n", - pindex->GetBlockHash().GetHex()); + LogPrint(BCLog::AVALANCHE, + "Avalanche rejected %s, parking\n", + pindex->GetBlockHash().GetHex()); BlockValidationState state; ::ChainstateActive().ParkBlock(config, state, pindex); if (!state.IsValid()) { @@ -4333,8 +4334,8 @@ } break; case avalanche::BlockUpdate::Status::Accepted: case avalanche::BlockUpdate::Status::Finalized: { - LogPrintf("Avalanche accepted %s\n", - pindex->GetBlockHash().GetHex()); + LogPrint(BCLog::AVALANCHE, "Avalanche accepted %s\n", + pindex->GetBlockHash().GetHex()); LOCK(cs_main); UnparkBlock(pindex); } break; @@ -4343,7 +4344,7 @@ BlockValidationState state; if (!ActivateBestChain(config, state)) { - LogPrint(BCLog::NET, "failed to activate chain (%s)\n", + LogPrint(BCLog::AVALANCHE, "failed to activate chain (%s)\n", state.ToString()); } } @@ -5743,7 +5744,8 @@ auto requestable = m_proofrequest.GetRequestable(pto->GetId(), current_time, &expired); for (const auto &entry : expired) { - LogPrint(BCLog::NET, "timeout of inflight proof %s from peer=%d\n", + LogPrint(BCLog::AVALANCHE, + "timeout of inflight proof %s from peer=%d\n", entry.second.ToString(), entry.first); } for (const auto &proofid : requestable) {