Browse Source

Merge pull request #2426 from arkpar/bc

Work around invalid NewBlock packet
cl-refactor
Gav Wood 10 years ago
parent
commit
1a6143e168
  1. 6
      libethereum/BlockChainSync.cpp

6
libethereum/BlockChainSync.cpp

@ -296,10 +296,14 @@ void BlockChainSync::onPeerNewBlock(std::shared_ptr<EthereumPeer> _peer, RLP con
case ImportResult::FutureTimeUnknown:
case ImportResult::UnknownParent:
{
logNewBlock(h);
clog(NetMessageDetail) << "Received block with no known parent. Resyncing...";
resetSyncFor(_peer, h, _r[1].toInt<u256>());
u256 totalDifficulty = _r[1].toInt<u256>();
if (totalDifficulty > _peer->m_totalDifficulty)
resetSyncFor(_peer, h, totalDifficulty);
break;
}
default:;
}

Loading…
Cancel
Save