@@ -287,7 +287,7 @@ bool AddLocal(const CService& addr_, int nScore)
287287 if (!g_reachable_nets.Contains (addr))
288288 return false ;
289289
290- LogPrintf (" AddLocal(%s,%i)\n " , addr.ToStringAddrPort (), nScore);
290+ LogInfo (" AddLocal(%s,%i)\n " , addr.ToStringAddrPort (), nScore);
291291
292292 {
293293 LOCK (g_maplocalhost_mutex);
@@ -310,7 +310,7 @@ bool AddLocal(const CNetAddr &addr, int nScore)
310310void RemoveLocal (const CService& addr)
311311{
312312 LOCK (g_maplocalhost_mutex);
313- LogPrintf (" RemoveLocal(%s)\n " , addr.ToStringAddrPort ());
313+ LogInfo (" RemoveLocal(%s)\n " , addr.ToStringAddrPort ());
314314 mapLocalHost.erase (addr);
315315}
316316
@@ -421,7 +421,7 @@ CNode* CConnman::ConnectNode(CAddress addrConnect,
421421 // It is possible that we already have a connection to the IP/port pszDest resolved to.
422422 // In that case, drop the connection that was just created.
423423 if (AlreadyConnectedToAddressPort (addrConnect)) {
424- LogPrintf (" Not opening a connection to %s, already connected to %s\n " , pszDest, addrConnect.ToStringAddrPort ());
424+ LogInfo (" Not opening a connection to %s, already connected to %s\n " , pszDest, addrConnect.ToStringAddrPort ());
425425 return nullptr ;
426426 }
427427 // Add the address to the resolved addresses vector so we can try to connect to it later on
@@ -1739,7 +1739,7 @@ void CConnman::AcceptConnection(const ListenSocket& hListenSocket) {
17391739 if (!sock) {
17401740 const int nErr = WSAGetLastError ();
17411741 if (nErr != WSAEWOULDBLOCK) {
1742- LogPrintf (" socket error accept failed: %s\n " , NetworkErrorString (nErr));
1742+ LogInfo (" socket error accept failed: %s\n " , NetworkErrorString (nErr));
17431743 }
17441744 return ;
17451745 }
@@ -1785,7 +1785,7 @@ void CConnman::CreateNodeFromAcceptedSocket(std::unique_ptr<Sock>&& sock,
17851785 }
17861786
17871787 if (!sock->IsSelectable ()) {
1788- LogPrintf (" connection from %s dropped: non-selectable socket\n " , addr.ToStringAddrPort ());
1788+ LogInfo (" connection from %s dropped: non-selectable socket\n " , addr.ToStringAddrPort ());
17891789 return ;
17901790 }
17911791
@@ -2258,7 +2258,7 @@ void CConnman::ThreadDNSAddressSeed()
22582258 if (!gArgs .GetArgs (" -seednode" ).empty ()) {
22592259 auto start = NodeClock::now ();
22602260 constexpr std::chrono::seconds SEEDNODE_TIMEOUT = 30s;
2261- LogPrintf (" -seednode enabled. Trying the provided seeds for %d seconds before defaulting to the dnsseeds.\n " , SEEDNODE_TIMEOUT.count ());
2261+ LogInfo (" -seednode enabled. Trying the provided seeds for %d seconds before defaulting to the dnsseeds.\n " , SEEDNODE_TIMEOUT.count ());
22622262 while (!m_interrupt_net->interrupted ()) {
22632263 if (!m_interrupt_net->sleep_for (500ms)) {
22642264 return ;
@@ -2267,13 +2267,13 @@ void CConnman::ThreadDNSAddressSeed()
22672267 // Abort if we have spent enough time without reaching our target.
22682268 // Giving seed nodes 30 seconds so this does not become a race against fixedseeds (which triggers after 1 min)
22692269 if (NodeClock::now () > start + SEEDNODE_TIMEOUT) {
2270- LogPrintf (" Couldn't connect to enough peers via seed nodes. Handing fetch logic to the DNS seeds.\n " );
2270+ LogInfo (" Couldn't connect to enough peers via seed nodes. Handing fetch logic to the DNS seeds.\n " );
22712271 break ;
22722272 }
22732273
22742274 outbound_connection_count = GetFullOutboundConnCount ();
22752275 if (outbound_connection_count >= SEED_OUTBOUND_CONNECTION_THRESHOLD) {
2276- LogPrintf (" P2P peers available. Finished fetching data from seed nodes.\n " );
2276+ LogInfo (" P2P peers available. Finished fetching data from seed nodes.\n " );
22772277 break ;
22782278 }
22792279 }
@@ -2316,7 +2316,7 @@ void CConnman::ThreadDNSAddressSeed()
23162316 seeds_right_now += DNSSEEDS_TO_QUERY_AT_ONCE;
23172317
23182318 if (addrman.Size () > 0 ) {
2319- LogPrintf (" Waiting %d seconds before querying DNS seeds.\n " , seeds_wait_time.count ());
2319+ LogInfo (" Waiting %d seconds before querying DNS seeds.\n " , seeds_wait_time.count ());
23202320 std::chrono::seconds to_wait = seeds_wait_time;
23212321 while (to_wait.count () > 0 ) {
23222322 // if sleeping for the MANY_PEERS interval, wake up
@@ -2328,10 +2328,10 @@ void CConnman::ThreadDNSAddressSeed()
23282328
23292329 if (GetFullOutboundConnCount () >= SEED_OUTBOUND_CONNECTION_THRESHOLD) {
23302330 if (found > 0 ) {
2331- LogPrintf (" %d addresses found from DNS seeds\n " , found);
2332- LogPrintf (" P2P peers available. Finished DNS seeding.\n " );
2331+ LogInfo (" %d addresses found from DNS seeds\n " , found);
2332+ LogInfo (" P2P peers available. Finished DNS seeding.\n " );
23332333 } else {
2334- LogPrintf (" P2P peers available. Skipped DNS seeding.\n " );
2334+ LogInfo (" P2P peers available. Skipped DNS seeding.\n " );
23352335 }
23362336 return ;
23372337 }
@@ -2343,13 +2343,13 @@ void CConnman::ThreadDNSAddressSeed()
23432343
23442344 // hold off on querying seeds if P2P network deactivated
23452345 if (!fNetworkActive ) {
2346- LogPrintf (" Waiting for network to be reactivated before querying DNS seeds.\n " );
2346+ LogInfo (" Waiting for network to be reactivated before querying DNS seeds.\n " );
23472347 do {
23482348 if (!m_interrupt_net->sleep_for (1s)) return ;
23492349 } while (!fNetworkActive );
23502350 }
23512351
2352- LogPrintf (" Loading addresses from DNS seed %s\n " , seed);
2352+ LogInfo (" Loading addresses from DNS seed %s\n " , seed);
23532353 // If -proxy is in use, we make an ADDR_FETCH connection to the DNS resolved peer address
23542354 // for the base dns seed domain in chainparams
23552355 if (HaveNameProxy ()) {
@@ -2385,9 +2385,9 @@ void CConnman::ThreadDNSAddressSeed()
23852385 }
23862386 --seeds_right_now;
23872387 }
2388- LogPrintf (" %d addresses found from DNS seeds\n " , found);
2388+ LogInfo (" %d addresses found from DNS seeds\n " , found);
23892389 } else {
2390- LogPrintf (" Skipping DNS seeds. Enough peers have been found\n " );
2390+ LogInfo (" Skipping DNS seeds. Enough peers have been found\n " );
23912391 }
23922392}
23932393
@@ -2568,7 +2568,7 @@ void CConnman::ThreadOpenConnections(const std::vector<std::string> connect, std
25682568 constexpr std::chrono::seconds ADD_NEXT_SEEDNODE = 10s;
25692569
25702570 if (!add_fixed_seeds) {
2571- LogPrintf (" Fixed seeds are disabled\n " );
2571+ LogInfo (" Fixed seeds are disabled\n " );
25722572 }
25732573
25742574 while (!m_interrupt_net->interrupted ()) {
@@ -2607,15 +2607,15 @@ void CConnman::ThreadOpenConnections(const std::vector<std::string> connect, std
26072607 // It is cheapest to check if enough time has passed first.
26082608 if (GetTime<std::chrono::seconds>() > start + std::chrono::minutes{1 }) {
26092609 add_fixed_seeds_now = true ;
2610- LogPrintf (" Adding fixed seeds as 60 seconds have passed and addrman is empty for at least one reachable network\n " );
2610+ LogInfo (" Adding fixed seeds as 60 seconds have passed and addrman is empty for at least one reachable network\n " );
26112611 }
26122612
26132613 // Perform cheap checks before locking a mutex.
26142614 else if (!dnsseed && !use_seednodes) {
26152615 LOCK (m_added_nodes_mutex);
26162616 if (m_added_node_params.empty ()) {
26172617 add_fixed_seeds_now = true ;
2618- LogPrintf (" Adding fixed seeds as -dnsseed=0 (or IPv4/IPv6 connections are disabled via -onlynet) and neither -addnode nor -seednode are provided\n " );
2618+ LogInfo (" Adding fixed seeds as -dnsseed=0 (or IPv4/IPv6 connections are disabled via -onlynet) and neither -addnode nor -seednode are provided\n " );
26192619 }
26202620 }
26212621
@@ -2634,7 +2634,7 @@ void CConnman::ThreadOpenConnections(const std::vector<std::string> connect, std
26342634 local.SetInternal (" fixedseeds" );
26352635 addrman.Add (seed_addrs, local);
26362636 add_fixed_seeds = false ;
2637- LogPrintf (" Added %d fixed seeds from reachable networks.\n " , seed_addrs.size ());
2637+ LogInfo (" Added %d fixed seeds from reachable networks.\n " , seed_addrs.size ());
26382638 }
26392639 }
26402640
@@ -3158,7 +3158,7 @@ bool CConnman::BindListenPort(const CService& addrBind, bilingual_str& strError,
31583158 // the program was closed and restarted.
31593159 if (sock->SetSockOpt (SOL_SOCKET, SO_REUSEADDR, &nOne, sizeof (int )) == SOCKET_ERROR) {
31603160 strError = Untranslated (strprintf (" Error setting SO_REUSEADDR on socket: %s, continuing anyway" , NetworkErrorString (WSAGetLastError ())));
3161- LogPrintf (" %s\n " , strError.original );
3161+ LogInfo (" %s\n " , strError.original );
31623162 }
31633163
31643164 // some systems don't have IPV6_V6ONLY but are always v6only; others do have the option
@@ -3167,14 +3167,14 @@ bool CConnman::BindListenPort(const CService& addrBind, bilingual_str& strError,
31673167#ifdef IPV6_V6ONLY
31683168 if (sock->SetSockOpt (IPPROTO_IPV6, IPV6_V6ONLY, &nOne, sizeof (int )) == SOCKET_ERROR) {
31693169 strError = Untranslated (strprintf (" Error setting IPV6_V6ONLY on socket: %s, continuing anyway" , NetworkErrorString (WSAGetLastError ())));
3170- LogPrintf (" %s\n " , strError.original );
3170+ LogInfo (" %s\n " , strError.original );
31713171 }
31723172#endif
31733173#ifdef WIN32
31743174 int nProtLevel = PROTECTION_LEVEL_UNRESTRICTED;
31753175 if (sock->SetSockOpt (IPPROTO_IPV6, IPV6_PROTECTION_LEVEL, &nProtLevel, sizeof (int )) == SOCKET_ERROR) {
31763176 strError = Untranslated (strprintf (" Error setting IPV6_PROTECTION_LEVEL on socket: %s, continuing anyway" , NetworkErrorString (WSAGetLastError ())));
3177- LogPrintf (" %s\n " , strError.original );
3177+ LogInfo (" %s\n " , strError.original );
31783178 }
31793179#endif
31803180 }
@@ -3188,7 +3188,7 @@ bool CConnman::BindListenPort(const CService& addrBind, bilingual_str& strError,
31883188 LogPrintLevel (BCLog::NET, BCLog::Level::Error, " %s\n " , strError.original );
31893189 return false ;
31903190 }
3191- LogPrintf (" Bound to %s\n " , addrBind.ToStringAddrPort ());
3191+ LogInfo (" Bound to %s\n " , addrBind.ToStringAddrPort ());
31923192
31933193 // Listen for incoming connections
31943194 if (sock->Listen (SOMAXCONN) == SOCKET_ERROR)
@@ -3209,13 +3209,13 @@ void Discover()
32093209
32103210 for (const CNetAddr &addr: GetLocalAddresses ()) {
32113211 if (AddLocal (addr, LOCAL_IF))
3212- LogPrintf (" %s: %s\n " , __func__, addr.ToStringAddr ());
3212+ LogInfo (" %s: %s\n " , __func__, addr.ToStringAddr ());
32133213 }
32143214}
32153215
32163216void CConnman::SetNetworkActive (bool active)
32173217{
3218- LogPrintf (" %s: %s\n " , __func__, active);
3218+ LogInfo (" %s: %s\n " , __func__, active);
32193219
32203220 if (fNetworkActive == active) {
32213221 return ;
@@ -3350,7 +3350,7 @@ bool CConnman::Start(CScheduler& scheduler, const Options& connOptions)
33503350 if (m_anchors.size () > MAX_BLOCK_RELAY_ONLY_ANCHORS) {
33513351 m_anchors.resize (MAX_BLOCK_RELAY_ONLY_ANCHORS);
33523352 }
3353- LogPrintf (" %i block-relay-only anchors will be tried for connections.\n " , m_anchors.size ());
3353+ LogInfo (" %i block-relay-only anchors will be tried for connections.\n " , m_anchors.size ());
33543354 }
33553355
33563356 if (m_client_interface) {
@@ -3384,7 +3384,7 @@ bool CConnman::Start(CScheduler& scheduler, const Options& connOptions)
33843384 threadSocketHandler = std::thread (&util::TraceThread, " net" , [this ] { ThreadSocketHandler (); });
33853385
33863386 if (!gArgs .GetBoolArg (" -dnsseed" , DEFAULT_DNSSEED))
3387- LogPrintf (" DNS seeding disabled\n " );
3387+ LogInfo (" DNS seeding disabled\n " );
33883388 else
33893389 threadDNSAddressSeed = std::thread (&util::TraceThread, " dnsseed" , [this ] { ThreadDNSAddressSeed (); });
33903390
0 commit comments