aboutsummaryrefslogtreecommitdiff
path: root/src/init.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/init.cpp')
-rw-r--r--src/init.cpp49
1 files changed, 35 insertions, 14 deletions
diff --git a/src/init.cpp b/src/init.cpp
index 3fe6d1b09..60927f20b 100644
--- a/src/init.cpp
+++ b/src/init.cpp
@@ -178,12 +178,17 @@ bool AppInit2(int argc, char* argv[])
" -dbcache=<n> \t\t " + _("Set database cache size in megabytes (default: 25)") + "\n" +
" -dblogsize=<n> \t\t " + _("Set database disk log size in megabytes (default: 100)") + "\n" +
" -timeout=<n> \t " + _("Specify connection timeout (in milliseconds)") + "\n" +
- " -proxy=<ip:port> \t " + _("Connect through socks4 proxy") + "\n" +
- " -dns \t " + _("Allow DNS lookups for addnode and connect") + "\n" +
+ " -proxy=<ip:port> \t " + _("Connect through socks proxy") + "\n" +
+ " -socks=<n> \t " + _("Select the version of socks proxy to use (4 or 5, 5 is default)") + "\n" +
+ " -dns \t " + _("Allow DNS lookups for -addnode, -seednode and -connect") + "\n" +
+ " -proxydns \t " + _("Pass DNS requests to (SOCKS5) proxy") + "\n" +
" -port=<port> \t\t " + _("Listen for connections on <port> (default: 8333 or testnet: 18333)") + "\n" +
" -maxconnections=<n>\t " + _("Maintain at most <n> connections to peers (default: 125)") + "\n" +
" -addnode=<ip> \t " + _("Add a node to connect to and attempt to keep the connection open") + "\n" +
" -connect=<ip> \t\t " + _("Connect only to the specified node") + "\n" +
+ " -seednode=<ip> \t\t " + _("Connect to a node to retrieve peer addresses, and disconnect") + "\n" +
+ " -externalip=<ip> \t " + _("Specify your own public address") + "\n" +
+ " -discover \t " + _("Try to discover public IP address (default: 1)") + "\n" +
" -irc \t " + _("Find peers using internet relay chat (default: 0)") + "\n" +
" -listen \t " + _("Accept connections from outside (default: 1)") + "\n" +
#ifdef QT_GUI
@@ -226,7 +231,8 @@ bool AppInit2(int argc, char* argv[])
" -keypool=<n> \t " + _("Set key pool size to <n> (default: 100)") + "\n" +
" -rescan \t " + _("Rescan the block chain for missing wallet transactions") + "\n" +
" -checkblocks=<n> \t\t " + _("How many blocks to check at startup (default: 2500, 0 = all)") + "\n" +
- " -checklevel=<n> \t\t " + _("How thorough the block verification is (0-6, default: 1)") + "\n";
+ " -checklevel=<n> \t\t " + _("How thorough the block verification is (0-6, default: 1)") + "\n" +
+ " -loadblock=<file>\t " + _("Imports blocks from external blk000?.dat file") + "\n";
strUsage += string() +
_("\nSSL options: (see the Bitcoin Wiki for SSL setup instructions)") + "\n" +
@@ -367,6 +373,16 @@ bool AppInit2(int argc, char* argv[])
}
printf(" block index %15"PRI64d"ms\n", GetTimeMillis() - nStart);
+ if (mapArgs.count("-loadblock"))
+ {
+ BOOST_FOREACH(string strFile, mapMultiArgs["-loadblock"])
+ {
+ FILE *file = fopen(strFile.c_str(), "rb");
+ if (file)
+ LoadExternalBlockFile(file);
+ }
+ }
+
InitMessage(_("Loading wallet..."));
printf("Loading wallet...\n");
nStart = GetTimeMillis();
@@ -516,6 +532,9 @@ bool AppInit2(int argc, char* argv[])
}
}
+ if (mapArgs.count("-connect"))
+ SoftSetBoolArg("-dnsseed", false);
+
bool fTor = (fUseProxy && addrProxy.GetPort() == 9050);
if (fTor)
{
@@ -523,13 +542,20 @@ bool AppInit2(int argc, char* argv[])
// Note: the GetBoolArg() calls for all of these must happen later.
SoftSetBoolArg("-listen", false);
SoftSetBoolArg("-irc", false);
- SoftSetBoolArg("-dnsseed", false);
+ SoftSetBoolArg("-proxydns", true);
SoftSetBoolArg("-upnp", false);
- SoftSetBoolArg("-dns", false);
+ SoftSetBoolArg("-discover", false);
}
- fAllowDNS = GetBoolArg("-dns");
+ fNameLookup = GetBoolArg("-dns");
+ fProxyNameLookup = GetBoolArg("-proxydns");
+ if (fProxyNameLookup)
+ fNameLookup = true;
fNoListen = !GetBoolArg("-listen", true);
+ nSocksVersion = GetArg("-socks", 5);
+
+ BOOST_FOREACH(string strDest, mapMultiArgs["-seednode"])
+ AddOneShot(strDest);
// Continue to put "/P2SH/" in the coinbase to monitor
// BIP16 support.
@@ -547,15 +573,10 @@ bool AppInit2(int argc, char* argv[])
}
}
- if (mapArgs.count("-addnode"))
+ if (mapArgs.count("-externalip"))
{
- BOOST_FOREACH(string strAddr, mapMultiArgs["-addnode"])
- {
- CAddress addr(CService(strAddr, GetDefaultPort(), fAllowDNS));
- addr.nTime = 0; // so it won't relay unless successfully connected
- if (addr.IsValid())
- addrman.Add(addr, CNetAddr("127.0.0.1"));
- }
+ BOOST_FOREACH(string strAddr, mapMultiArgs["-externalip"])
+ AddLocal(CNetAddr(strAddr, fNameLookup), LOCAL_MANUAL);
}
if (mapArgs.count("-paytxfee"))