Tim Hughes 11 years ago
parent
commit
59c9da7f00
  1. 10
      libethereum/PeerNetwork.cpp

10
libethereum/PeerNetwork.cpp

@ -316,7 +316,9 @@ bool PeerSession::interpret(RLP const& _r)
else
clogS(NetMessageDetail) << "Known parent " << bi.parentHash << " of block " << h;
}
if (used) // we received some - check if there's any more
// TJH: This check stops us downloading a forked chain when we already have the
// beginning of the fork.
//if (used) // we received some - check if there's any more
{
RLPStream s;
prep(s).appendList(3);
@ -1021,7 +1023,11 @@ bool PeerServer::sync(BlockChain& _bc, TransactionQueue& _tq, Overlay& _o)
if (it == m_incomingBlocks.begin())
break;
}
if (!n && accepted)
// TJH: If we don't keep trying we'll leave lots of usable blocks
// in m_unknownParents until an incoming block arrives. Should
// probably replace with a better algorithm.
// if (!n && accepted)
if (accepted)
{
for (auto i: m_unknownParentBlocks)
m_incomingBlocks.push_back(i);

Loading…
Cancel
Save