Must update positions even if not proposing. Otherwise, we never realize there's a consensus on close times.

This commit is contained in:
JoelKatz
2012-07-13 10:35:08 -07:00
parent 92dce90b90
commit 2463d25682

View File

@@ -381,9 +381,12 @@ int LedgerConsensus::stateEstablish()
{ // we are establishing consensus
if (mCurrentSeconds < LEDGER_MIN_CONSENSUS)
return 1;
if (mProposing)
updateOurPositions();
if (haveConsensus() && mHaveCloseTimeConsensus)
updateOurPositions();
if (!mHaveCloseTimeConsensus)
{
Log(lsINFO) << "No close time consensus";
}
else if (haveConsensus())
{
Log(lsINFO) << "Converge cutoff";
mState = lcsFINISHED;
@@ -441,6 +444,7 @@ void LedgerConsensus::timerEntry()
void LedgerConsensus::updateOurPositions()
{
Log(lsINFO) << "Updating our positions";
bool changes = false;
SHAMap::pointer ourPosition;
std::vector<uint256> addedTx, removedTx;