Browse Source

Merge pull request #4247 from Diapolo/listen

rename fNoListen to fListen and move to net
0.10
Jeff Garzik 11 years ago
parent
commit
c79897af31
  1. 4
      src/init.cpp
  2. 4
      src/main.cpp
  3. 3
      src/net.cpp
  4. 1
      src/net.h
  5. 1
      src/util.cpp
  6. 1
      src/util.h

4
src/init.cpp

@ -733,12 +733,12 @@ bool AppInit2(boost::thread_group& threadGroup)
} }
// see Step 2: parameter interactions for more information about these // see Step 2: parameter interactions for more information about these
fNoListen = !GetBoolArg("-listen", true); fListen = GetBoolArg("-listen", true);
fDiscover = GetBoolArg("-discover", true); fDiscover = GetBoolArg("-discover", true);
fNameLookup = GetBoolArg("-dns", true); fNameLookup = GetBoolArg("-dns", true);
bool fBound = false; bool fBound = false;
if (!fNoListen) { if (fListen) {
if (mapArgs.count("-bind")) { if (mapArgs.count("-bind")) {
BOOST_FOREACH(std::string strBind, mapMultiArgs["-bind"]) { BOOST_FOREACH(std::string strBind, mapMultiArgs["-bind"]) {
CService addrBind; CService addrBind;

4
src/main.cpp

@ -3562,7 +3562,7 @@ bool static ProcessMessage(CNode* pfrom, string strCommand, CDataStream& vRecv)
if (!pfrom->fInbound) if (!pfrom->fInbound)
{ {
// Advertise our address // Advertise our address
if (!fNoListen && !IsInitialBlockDownload()) if (fListen && !IsInitialBlockDownload())
{ {
CAddress addr = GetLocalAddress(&pfrom->addr); CAddress addr = GetLocalAddress(&pfrom->addr);
if (addr.IsRoutable()) if (addr.IsRoutable())
@ -4330,7 +4330,7 @@ bool SendMessages(CNode* pto, bool fSendTrickle)
pnode->setAddrKnown.clear(); pnode->setAddrKnown.clear();
// Rebroadcast our address // Rebroadcast our address
if (!fNoListen) if (fListen)
{ {
CAddress addr = GetLocalAddress(&pnode->addr); CAddress addr = GetLocalAddress(&pnode->addr);
if (addr.IsRoutable()) if (addr.IsRoutable())

3
src/net.cpp

@ -45,6 +45,7 @@ static const int MAX_OUTBOUND_CONNECTIONS = 8;
// Global state variables // Global state variables
// //
bool fDiscover = true; bool fDiscover = true;
bool fListen = true;
uint64_t nLocalServices = NODE_NETWORK; uint64_t nLocalServices = NODE_NETWORK;
CCriticalSection cs_mapLocalHost; CCriticalSection cs_mapLocalHost;
map<CNetAddr, LocalServiceInfo> mapLocalHost; map<CNetAddr, LocalServiceInfo> mapLocalHost;
@ -96,7 +97,7 @@ unsigned short GetListenPort()
// find 'best' local address for a particular peer // find 'best' local address for a particular peer
bool GetLocal(CService& addr, const CNetAddr *paddrPeer) bool GetLocal(CService& addr, const CNetAddr *paddrPeer)
{ {
if (fNoListen) if (!fListen)
return false; return false;
int nBestScore = -1; int nBestScore = -1;

1
src/net.h

@ -105,6 +105,7 @@ CAddress GetLocalAddress(const CNetAddr *paddrPeer = NULL);
extern bool fDiscover; extern bool fDiscover;
extern bool fListen;
extern uint64_t nLocalServices; extern uint64_t nLocalServices;
extern uint64_t nLocalHostNonce; extern uint64_t nLocalHostNonce;
extern CAddrMan addrman; extern CAddrMan addrman;

1
src/util.cpp

@ -94,7 +94,6 @@ bool fPrintToDebugLog = true;
bool fDaemon = false; bool fDaemon = false;
bool fServer = false; bool fServer = false;
string strMiscWarning; string strMiscWarning;
bool fNoListen = false;
bool fLogTimestamps = false; bool fLogTimestamps = false;
volatile bool fReopenDebugLog = false; volatile bool fReopenDebugLog = false;
CClientUIInterface uiInterface; CClientUIInterface uiInterface;

1
src/util.h

@ -100,7 +100,6 @@ extern bool fPrintToConsole;
extern bool fPrintToDebugLog; extern bool fPrintToDebugLog;
extern bool fServer; extern bool fServer;
extern std::string strMiscWarning; extern std::string strMiscWarning;
extern bool fNoListen;
extern bool fLogTimestamps; extern bool fLogTimestamps;
extern volatile bool fReopenDebugLog; extern volatile bool fReopenDebugLog;

Loading…
Cancel
Save