Browse Source

Fix bool.

cl-refactor
subtly 10 years ago
parent
commit
0a0d36382b
  1. 6
      eth/main.cpp
  2. 2
      libp2p/Network.h
  3. 4
      libp2p/NodeTable.cpp
  4. 2
      libp2p/NodeTable.h

6
eth/main.cpp

@ -598,12 +598,6 @@ int main(int argc, char** argv)
else if (arg == "-b" || arg == "--bootstrap") else if (arg == "-b" || arg == "--bootstrap")
bootstrap = true; bootstrap = true;
else if (arg == "--no-discovery") else if (arg == "--no-discovery")
if (bootstrap)
{
cerr << "-b/--bootstrap cannot be used with --no-discovery." << endl;
return -1;
}
else
disableDiscovery = true; disableDiscovery = true;
else if (arg == "--pin") else if (arg == "--pin")
pinning = true; pinning = true;

2
libp2p/Network.h

@ -51,9 +51,9 @@ struct NetworkPreferences
std::string publicIPAddress; std::string publicIPAddress;
std::string listenIPAddress; std::string listenIPAddress;
unsigned short listenPort = 30303; unsigned short listenPort = 30303;
bool traverseNAT = true;
bool discovery = true; // Discovery is activated with network. bool discovery = true; // Discovery is activated with network.
bool pin = false; // Only connect to trusted ("required") peers. bool pin = false; // Only connect to trusted ("required") peers.
bool traverseNAT = true;
}; };
/** /**

4
libp2p/NodeTable.cpp

@ -40,7 +40,7 @@ const char* NodeTableIngress::name() { return "<<P"; }
NodeEntry::NodeEntry(NodeId const& _src, Public const& _pubk, NodeIPEndpoint const& _gw): Node(_pubk, _gw), distance(NodeTable::distance(_src, _pubk)) {} NodeEntry::NodeEntry(NodeId const& _src, Public const& _pubk, NodeIPEndpoint const& _gw): Node(_pubk, _gw), distance(NodeTable::distance(_src, _pubk)) {}
NodeTable::NodeTable(ba::io_service& _io, KeyPair const& _alias, NodeIPEndpoint const& _endpoint, bool _disabled): NodeTable::NodeTable(ba::io_service& _io, KeyPair const& _alias, NodeIPEndpoint const& _endpoint, bool _enabled):
m_node(Node(_alias.pub(), _endpoint)), m_node(Node(_alias.pub(), _endpoint)),
m_secret(_alias.sec()), m_secret(_alias.sec()),
m_io(_io), m_io(_io),
@ -48,7 +48,7 @@ NodeTable::NodeTable(ba::io_service& _io, KeyPair const& _alias, NodeIPEndpoint
m_socketPointer(m_socket.get()), m_socketPointer(m_socket.get()),
m_bucketRefreshTimer(m_io), m_bucketRefreshTimer(m_io),
m_evictionCheckTimer(m_io), m_evictionCheckTimer(m_io),
m_disabled(_disabled) m_disabled(!_enabled)
{ {
for (unsigned i = 0; i < s_bins; i++) for (unsigned i = 0; i < s_bins; i++)
{ {

2
libp2p/NodeTable.h

@ -130,7 +130,7 @@ public:
enum NodeRelation { Unknown = 0, Known }; enum NodeRelation { Unknown = 0, Known };
/// Constructor requiring host for I/O, credentials, and IP Address and port to listen on. /// Constructor requiring host for I/O, credentials, and IP Address and port to listen on.
NodeTable(ba::io_service& _io, KeyPair const& _alias, NodeIPEndpoint const& _endpoint, bool _disabled = false); NodeTable(ba::io_service& _io, KeyPair const& _alias, NodeIPEndpoint const& _endpoint, bool _enabled = true);
~NodeTable(); ~NodeTable();
/// Returns distance based on xor metric two node ids. Used by NodeEntry and NodeTable. /// Returns distance based on xor metric two node ids. Used by NodeEntry and NodeTable.

Loading…
Cancel
Save