mirror of
https://github.com/XRPLF/rippled.git
synced 2025-12-06 17:27:55 +00:00
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:
@@ -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);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user