Skip to content

Commit 6539bbb

Browse files
committed
Lower verbosity, check if conversation has ended to stop connection
1 parent ec8aa19 commit 6539bbb

File tree

3 files changed

+4
-2
lines changed

3 files changed

+4
-2
lines changed

dcc_client/dcc_client/P2PClient.cpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -288,7 +288,6 @@ void P2P::ListenerThread(int update_interval)
288288

289289
otherAddrStr = fromIPString;
290290
SetPeer(otherAddrStr);
291-
std::cout << "New peer found at: " << otherAddrStr << std::endl;
292291
}
293292

294293
// If connected but different, ignore.
@@ -526,6 +525,7 @@ void P2P::ListenerThread(int update_interval)
526525

527526
p2pConnections[otherAddrStr]->height = announcedInfo["height"];
528527
p2pConnections[otherAddrStr]->peerList = announcedInfo["peerList"];
528+
p2pConnections[otherAddrStr]->testedOnline = true;
529529

530530
messageStatus = await_first_success;
531531
if (WalletSettingValues::verbose >= 7) {
@@ -739,7 +739,8 @@ int P2P::OpenP2PSocket(int port)
739739

740740
// Function to get random peer credentials from the peerList
741741
void P2P::RandomizePeer() {
742-
messageStatus = initial_connect_request;
742+
if(!isServer)
743+
messageStatus = initial_connect_request;
743744
if (p2pConnections.size() == 0)
744745
{
745746
peerListID = DCCARK_ADDR;
@@ -872,6 +873,7 @@ void P2P::SenderThread()
872873
if (messageAttempt >= 2) {
873874
messageStatus = idle;
874875
messageAttempt = 0;
876+
otherAddrStr = "";
875877
continue;
876878
}
877879
}
Binary file not shown.
8 Bytes
Binary file not shown.

0 commit comments

Comments
 (0)