For now, detect clocks out of sync and disallow connection.

Improve speed of ledger synchronization by compressing all three base queries into one.
This commit is contained in:
JoelKatz
2012-06-30 22:17:53 -07:00
parent 51100a3b30
commit c7eb0269c2
6 changed files with 100 additions and 20 deletions

View File

@@ -388,7 +388,7 @@ bool NetworkOPs::checkLastClosedLedger(const std::vector<Peer::pointer>& peerLis
else if ((*it)->isConnected())
{
uint256 peerLedger = (*it)->getClosedLedgerHash();
if (!!peerLedger)
if (peerLedger.isNonZero())
{
ValidationCount& vc = ledgers[peerLedger];
if ((vc.nodesUsing == 0) || ((*it)->getNodePublic() > vc.highNode))
@@ -513,7 +513,8 @@ int NetworkOPs::beginConsensus(const uint256& networkClosed, Ledger::pointer clo
assert(closingLedger->getParentHash() == mLedgerMaster->getClosedLedger()->getHash());
// Create a consensus object to get consensus on this ledger
if (!!mConsensus) mConsensus->abort();
if (!!mConsensus)
mConsensus->abort();
prevLedger->setImmutable();
mConsensus = boost::make_shared<LedgerConsensus>(
networkClosed,