Skip to content

Commit 5f45168

Browse files
committed
[remove] add logging
1 parent 2b83c0e commit 5f45168

File tree

3 files changed

+10
-0
lines changed

3 files changed

+10
-0
lines changed

src/init.cpp

+1
Original file line numberDiff line numberDiff line change
@@ -942,6 +942,7 @@ bool AppInitParameterInteraction(const ArgsManager& args)
942942
nLocalServices = ServiceFlags(nLocalServices | NODE_P2P_V2);
943943
if (args.GetBoolArg("-v2onlyclearnet", false)) {
944944
disable_v1conn_clearnet = true;
945+
LogPrintf("### BLANKET V2 ONLY OPTION SET\n");
945946
}
946947
} else if (args.GetBoolArg("-v2onlyclearnet", false)) {
947948
return InitError(_("Cannot set -v2onlyclearnet to true when v2transport is disabled."));

src/net.cpp

+7
Original file line numberDiff line numberDiff line change
@@ -1901,6 +1901,11 @@ void CConnman::DisconnectNodes()
19011901
.conn_type = pnode->m_conn_type,
19021902
.use_v2transport = false});
19031903
LogPrint(BCLog::NET, "retrying with v1 transport protocol for peer=%d\n", pnode->GetId());
1904+
} else {
1905+
LogPrintf("### 2. DisconnectNodes(): NOT RETRYING WITH V1 FOR %s\n", pnode->addr.ToStringAddrPort());
1906+
LogPrintf("### Network = %d\n", pnode->ConnectedThroughNetwork());
1907+
LogPrintf("### pnode->m_transport->ShouldReconnectV1() = %d\n", pnode->m_transport->ShouldReconnectV1());
1908+
LogPrintf("### !DisableV1OnClearnet(pnode->addr.GetNetClass()) = %d\n", !DisableV1OnClearnet(pnode->addr.GetNetClass()));
19041909
}
19051910

19061911
// release outbound grant (if any)
@@ -2743,6 +2748,7 @@ void CConnman::ThreadOpenConnections(const std::vector<std::string> connect)
27432748

27442749
bool use_v2transport(addr.nServices & GetLocalServices() & NODE_P2P_V2);
27452750
if (DisableV1OnClearnet(addr.GetNetClass()) && !use_v2transport) {
2751+
LogPrintf("### 3. ThreadOpenConnections(): %s selected from addrman for making BLOCK + FEELER + OUTBOUND is NOT V2 - WE LOOP AGAIN FOR V2\n", addr.ToStringAddrPort());
27462752
continue;
27472753
}
27482754

@@ -2929,6 +2935,7 @@ void CConnman::OpenNetworkConnection(const CAddress& addrConnect, bool fCountFai
29292935
return;
29302936

29312937
if (DisableV1OnClearnet(addrConnect.GetNetClass()) && !use_v2transport) {
2938+
LogPrintf("### 4. OpenNetworkConnection(): %s is NOT V2 PEER\n", addrConnect.ToStringAddrPort());
29322939
return;
29332940
}
29342941

src/net_processing.cpp

+2
Original file line numberDiff line numberDiff line change
@@ -3736,6 +3736,8 @@ void PeerManagerImpl::ProcessMessage(CNode& pfrom, const std::string& msg_type,
37363736

37373737
const bool is_v1transport = pfrom.m_transport->GetInfo().transport_type == TransportProtocolType::V1;
37383738
if (pfrom.IsInboundConn() && is_v1transport && m_connman.DisableV1OnClearnet(pfrom.ConnectedThroughNetwork())){
3739+
LogPrintf("### 1. ProcessMessage(): INBOUND CONNECTION from %s is NOT V2 PEER\n", pfrom.addr.ToStringAddrPort());
3740+
LogPrintf("### nServices & NODE_P2P_V2 = %d\n", nServices & NODE_P2P_V2);
37393741
pfrom.fDisconnect = true;
37403742
return;
37413743
}

0 commit comments

Comments
 (0)