Browse Source

Kill old database (invalid transactions in there).

cl-refactor
Gav Wood 11 years ago
parent
commit
3ac0eb089b
  1. 4
      libethcore/CommonEth.cpp
  2. 4
      libp2p/Session.cpp

4
libethcore/CommonEth.cpp

@ -34,8 +34,8 @@ namespace dev
namespace eth
{
const unsigned c_protocolVersion = 34;
const unsigned c_databaseVersion = 2;
const unsigned c_protocolVersion = 35;
const unsigned c_databaseVersion = 3;
static const vector<pair<u256, string>> g_units =
{

4
libp2p/Session.cpp

@ -44,7 +44,7 @@ Session::Session(Host* _s, bi::tcp::socket _socket, bi::tcp::endpoint const& _ma
{
m_lastReceived = m_connect = std::chrono::steady_clock::now();
m_info = PeerInfo({NodeId(), "?", m_manualEndpoint.address().to_string(), m_manualEndpoint.port(), std::chrono::steady_clock::duration(0), CapDescSet(), 0, map<string, string>()});
m_info = PeerInfo({NodeId(), "?", m_manualEndpoint.address().to_string(), 0, std::chrono::steady_clock::duration(0), CapDescSet(), 0, map<string, string>()});
}
Session::Session(Host* _s, bi::tcp::socket _socket, std::shared_ptr<Node> const& _n, bool _force):
@ -317,7 +317,7 @@ bool Session::interpret(RLP const& _r)
// See if it's any better that ours or not...
// This could be the public address of a known node.
// SECURITY: remove this in beta - it's only for lazy connections and presents an easy attack vector.
if (m_server->m_nodes.count(id) && isPrivateAddress(m_server->m_nodes.at(id)->address.address()))
if (m_server->m_nodes.count(id) && isPrivateAddress(m_server->m_nodes.at(id)->address.address()) && ep.port() != 0)
// Update address if the node if we now have a public IP for it.
m_server->m_nodes[id]->address = ep;
goto CONTINUE;

Loading…
Cancel
Save