Browse Source

work around invalid NewBlock packet

cl-refactor
arkpar 10 years ago
parent
commit
56091064db
  1. 8
      libethereum/BlockChainSync.cpp

8
libethereum/BlockChainSync.cpp

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

Loading…
Cancel
Save