Perhaps a fix for the problem. Try to make sure there's no window in which

we can receive a proposal and be unable to act on it, even if our clock is
way off and there are no transactions.

The basic problem is this: With no transactions and no clock
synchronization, we have no way to know when to close an idle ledger.
This commit is contained in:
JoelKatz
2012-08-28 23:44:29 -07:00
parent 54eca8a3bb
commit 004f3719a5

View File

@@ -614,12 +614,6 @@ bool NetworkOPs::recvPropose(uint32 proposeSeq, const uint256& proposeHash, uint
if (!theApp->isNew(s.getSHA512Half()))
return false;
if (!mConsensus)
{ // FIXME: CLC
Log(lsWARNING) << "Received proposal when full but not during consensus window";
return false;
}
NewcoinAddress naPeerPublic = NewcoinAddress::createNodePublic(strCopy(pubKey));
LedgerProposal::pointer proposal =
boost::make_shared<LedgerProposal>(mConsensus->getLCL(), proposeSeq, proposeHash, closeTime, naPeerPublic);
@@ -637,6 +631,22 @@ bool NetworkOPs::recvPropose(uint32 proposeSeq, const uint256& proposeHash, uint
return true;
}
if ((!mConsensus) && (mMode == omFULL))
{
uint256 networkClosed;
bool ledgerChange = checkLastClosedLedger(peerList, networkClosed);
if (!ledgerChange)
{
Log(lsWARNING) << "Beginning consensus due to proposal from peer";
beginConsensus(networkClosed, theApp->getMasterLedger().getCurrentLedger());
}
}
if (!mConsensus)
{
Log(lsWARNING) << "Received proposal when full but not during consensus window";
return false;
}
return mConsensus->peerPosition(proposal);
}