// see Step 2: parameter interactions for more information about these
if (!IsLimited(NET_IPV4) || !IsLimited(NET_IPV6))
{
- fNoListen = !GetBoolArg("-listen", true);
+ fListen = GetBoolArg("-listen", true);
fDiscover = GetBoolArg("-discover", true);
fNameLookup = GetBoolArg("-dns", true);
} else {
// Don't listen, discover addresses or search for nodes if IPv4 and IPv6 networking is disabled.
- fNoListen = true;
+ fListen = false;
fDiscover = fNameLookup = false;
SoftSetBoolArg("-irc", false);
SoftSetBoolArg("-dnsseed", false);
}
bool fBound = false;
- if (!fNoListen)
+ if (fListen)
{
if (mapArgs.count("-bind")) {
for(std::string strBind : mapMultiArgs["-bind"]) {
return;
// ... or if we won't make outbound connections and won't accept inbound ones.
- if (mapArgs.count("-connect") && fNoListen)
+ if (mapArgs.count("-connect") && !fListen)
return;
// ... or if IRC is not enabled.
string strMyName;
// Don't use our IP as our nick if we're not listening
// or if it keeps failing because the nick is already in use.
- if (!fNoListen && GetLocal(addrLocal, &addrIPv4) && nNameRetry<3)
+ if (fListen && GetLocal(addrLocal, &addrIPv4) && nNameRetry<3)
strMyName = EncodeAddress(GetLocalAddress(&addrConnect));
if (strMyName.empty())
strMyName = strprintf("x%" PRIu64 "", GetRand(1000000000));
{
printf("GetIPFromIRC() returned %s\n", addrFromIRC.ToString().c_str());
// Don't use our IP as our nick if we're not listening
- if (!fNoListen && addrFromIRC.IsRoutable())
+ if (fListen && addrFromIRC.IsRoutable())
{
// IRC lets you to re-nick
AddLocal(addrFromIRC, LOCAL_IRC);
if (!pfrom->fInbound)
{
// Advertise our address
- if (!fNoListen && !IsInitialBlockDownload())
+ if (fListen && !IsInitialBlockDownload())
{
auto addr = GetLocalAddress(&pfrom->addr);
if (addr.IsRoutable())
//
bool fClient = false;
bool fDiscover = true;
+bool fListen = true;
uint64_t nLocalServices = (fClient ? 0 : NODE_NETWORK);
CCriticalSection cs_mapLocalHost;
map<CNetAddr, LocalServiceInfo> mapLocalHost;
// find 'best' local address for a particular peer
bool GetLocal(CService& addr, const CNetAddr *paddrPeer)
{
- if (fNoListen)
+ if (!fListen)
return false;
int nBestScore = -1;
// pushes our own address to a peer
void AdvertiseLocal(CNode *pnode)
{
- if (!fNoListen && pnode->fSuccessfullyConnected)
+ if (fListen && pnode->fSuccessfullyConnected)
{
auto addrLocal = GetLocalAddress(&pnode->addr);
// If discovery is enabled, sometimes give our peer the address it
extern bool fClient;
extern bool fDiscover;
-extern bool fNoListen;
+extern bool fListen;
extern bool fDiscover;
extern uint64_t nLocalServices;
bool fCommandLine = false;
string strMiscWarning;
bool fTestNet = false;
-bool fNoListen = false;
bool fLogTimestamps = false;
CMedianFilter<int64_t> vTimeOffsets(200,0);
bool fReopenDebugLog = false;
extern bool fCommandLine;
extern std::string strMiscWarning;
extern bool fTestNet;
-extern bool fNoListen;
extern bool fLogTimestamps;
extern bool fReopenDebugLog;