Changeset View
Standalone View
src/seeder/bitcoin.cpp
Show First 20 Lines • Show All 253 Lines • ▼ Show 20 Lines | if (you.IsValid()) { | ||||
&proxyConnectionFailed); | &proxyConnectionFailed); | ||||
} else { | } else { | ||||
// no proxy needed (none set for target network) | // no proxy needed (none set for target network) | ||||
sock = CreateSocket(you); | sock = CreateSocket(you); | ||||
if (sock == INVALID_SOCKET) { | if (sock == INVALID_SOCKET) { | ||||
return false; | return false; | ||||
} | } | ||||
// no proxy needed (none set for target network) | // no proxy needed (none set for target network) | ||||
connected = ConnectSocketDirectly(you, sock, nConnectTimeout, true); | connected = | ||||
ConnectSocketDirectly(you, sock, nConnectTimeout, false); | |||||
nakihito: This change prevents the seeder from flooding the log file and/or console with unsuccessful… | |||||
deadalnixUnsubmitted Not Done Inline ActionsSpecifying what the parameter actually means - and if we actually want to change the behavior - rather than changing the behavior randomly because the log output is large certainly would inspire more confidence. deadalnix: Specifying what the parameter actually means - and if we actually want to change the behavior… | |||||
deadalnixUnsubmitted Not Done Inline ActionsNote that if the previous behavior was wrong, then fixing it is warranted regardless of change in logging. If it wasn't wrong, then this is introducing a bug. deadalnix: Note that if the previous behavior was wrong, then fixing it is warranted regardless of change… | |||||
nakihitoAuthorUnsubmitted Done Inline ActionsThe parameter simply determines the log category connection failure message falls under (see https://reviews.bitcoinabc.org/source/bitcoin-abc-staging/browse/master/src/netbase.cpp$583-586 and https://reviews.bitcoinabc.org/source/bitcoin-abc-staging/browse/master/src/netbase.cpp$528. Because the seeder did not use the Logger class before, the parameter had no affect on behavior. nakihito: The parameter simply determines the log category connection failure message falls under (see… | |||||
deadalnixUnsubmitted Not Done Inline ActionsNo, the parameter specify if this is a manual connection or not and it happens that manual connections are logged differently. Is it correct to qualify these connection are manual or should they not be manual? If the value passed is wrong, then this needs to be fixed, regardless of the impact on logging. This is the whole point of using abstractions. If you need to dig into the other function to know this is changes only logging, then this is wrong, but even worse, if modifying this function require to be aware of every callers then things are bound to break. deadalnix: No, the parameter specify if this is a manual connection or not and it happens that manual… | |||||
} | } | ||||
} | } | ||||
if (!connected) { | if (!connected) { | ||||
// tfm::format(std::cout, "Cannot connect to %s\n", | // tfm::format(std::cout, "Cannot connect to %s\n", | ||||
// ToString(you)); | // ToString(you)); | ||||
CloseSocket(sock); | CloseSocket(sock); | ||||
return false; | return false; | ||||
▲ Show 20 Lines • Show All 59 Lines • Show Last 20 Lines |
This change prevents the seeder from flooding the log file and/or console with unsuccessful socket connection warnings causing the log file's size to explode.