Browse Source

GetChain fix.

cl-refactor
Gav Wood 11 years ago
parent
commit
5d8e77b041
  1. 10
      libethereum/PeerNetwork.cpp

10
libethereum/PeerNetwork.cpp

@ -144,12 +144,14 @@ bool PeerSession::interpret(RLP const& _r)
{
// ********************************************************************
// NEEDS FULL REWRITE!
h256s parents = _r[1].toVector<h256>();
if (!parents.size())
h256s parents;
parents.reserve(_r.itemCount() - 2);
for (unsigned i = 1; i < _r.itemCount() - 1; ++i)
parents.push_back(_r[i].toHash<h256>());
if (_r.itemCount() == 2)
break;
// return 2048 block max.
uint baseCount = (uint)min<bigint>(_r[2].toInt<bigint>(), 256);
uint baseCount = (uint)min<bigint>(_r[_r.itemCount() - 1].toInt<bigint>(), 256);
cout << std::setw(2) << m_socket.native_handle() << " | GetChain (" << baseCount << " max, from " << parents.front() << " to " << parents.back() << ")" << endl;
for (auto parent: parents)
{

Loading…
Cancel
Save