@@ -132,7 +132,6 @@ int main(int argc, char** argv)
132132
133133 string jsonAdmin;
134134 ChainParams chainParams;
135- string privateChain;
136135
137136 bool upnp = true ;
138137 WithExisting withExisting = WithExisting::Trust;
@@ -149,7 +148,6 @@ int main(int argc, char** argv)
149148 std::map<p2p::NodeID, pair<NodeIPEndpoint, bool >> preferredNodes;
150149 bool bootstrap = true ;
151150 bool disableDiscovery = false ;
152- bool enableDiscovery = false ;
153151 bool allowLocalDiscovery = false ;
154152 static const unsigned NoNetworkID = (unsigned )-1 ;
155153 unsigned networkID = NoNetworkID;
@@ -208,7 +206,6 @@ int main(int argc, char** argv)
208206 auto addClientOption = clientDefaultMode.add_options ();
209207 addClientOption (" mainnet" , " Use the main network protocol" );
210208 addClientOption (" ropsten" , " Use the Ropsten testnet" );
211- addClientOption (" private" , po::value<string>()->value_name (" <name>" ), " Use a private chain" );
212209 addClientOption (" test" , " Testing mode; disable PoW and provide test rpc interface" );
213210 addClientOption (" config" , po::value<string>()->value_name (" <file>" ),
214211 " Configure specialised blockchain using given JSON information\n " );
@@ -380,7 +377,6 @@ int main(int argc, char** argv)
380377 if (vm.count (" test" ))
381378 {
382379 testingMode = true ;
383- enableDiscovery = false ;
384380 disableDiscovery = true ;
385381 bootstrap = false ;
386382 }
@@ -623,16 +619,6 @@ int main(int argc, char** argv)
623619 cerr << " Bad " << " --network-id" << " option: " << vm[" network-id" ].as <string>() << " \n " ;
624620 return AlethErrors::BadNetworkIdOption;
625621 }
626- if (vm.count (" private" ))
627- try
628- {
629- privateChain = vm[" private" ].as <string>();
630- }
631- catch (...)
632- {
633- cerr << " Bad " << " --private" << " option: " << vm[" private" ].as <string>() << " \n " ;
634- return AlethErrors::BadPrivateOption;
635- }
636622 if (vm.count (" kill" ))
637623 withExisting = WithExisting::Kill;
638624 if (vm.count (" rebuild" ))
@@ -696,12 +682,6 @@ int main(int argc, char** argv)
696682
697683 setupLogging (loggingOptions);
698684
699- if (!privateChain.empty ())
700- {
701- chainParams.extraData = sha3 (privateChain).asBytes ();
702- chainParams.difficulty = chainParams.minimumDifficulty ;
703- chainParams.gasLimit = u256 (1 ) << 32 ;
704- }
705685
706686 if (!chainConfigIsSet)
707687 // default to mainnet if not already set with any of `--mainnet`, `--ropsten`, `--genesis`, `--config`
@@ -756,7 +736,7 @@ int main(int argc, char** argv)
756736 };
757737
758738 auto netPrefs = publicIP.empty () ? NetworkConfig (listenIP, listenPort, upnp) : NetworkConfig (publicIP, listenIP ,listenPort, upnp);
759- netPrefs.discovery = (privateChain. empty () && !disableDiscovery) || enableDiscovery ;
739+ netPrefs.discovery = !disableDiscovery;
760740 netPrefs.allowLocalDiscovery = allowLocalDiscovery;
761741 netPrefs.pin = vm.count (" pin" ) != 0 ;
762742
@@ -941,7 +921,7 @@ int main(int argc, char** argv)
941921 if (author)
942922 cout << " Mining Beneficiary: " << renderFullAddress (author) << " \n " ;
943923
944- if (bootstrap || !remoteHost.empty () || enableDiscovery || listenSet || !preferredNodes.empty ())
924+ if (bootstrap || !remoteHost.empty () || !disableDiscovery || listenSet || !preferredNodes.empty ())
945925 {
946926 web3.startNetwork ();
947927 cout << " Node ID: " << web3.enode () << " \n " ;
@@ -1026,7 +1006,7 @@ int main(int argc, char** argv)
10261006 else
10271007 web3.addNode (p.first , p.second .first );
10281008
1029- if (bootstrap && privateChain. empty () )
1009+ if (bootstrap)
10301010 for (auto const & i : defaultBootNodes ())
10311011 web3.requirePeer (i.first , i.second );
10321012 if (!remoteHost.empty ())
0 commit comments