Ledger switch logic.

This commit is contained in:
JoelKatz
2012-05-05 13:51:08 -07:00
parent 41be3dfd35
commit 5ada49d206
2 changed files with 11 additions and 2 deletions

View File

@@ -256,8 +256,7 @@ void NetworkOPs::checkState()
}
consensus = acq->getLedger();
}
// WRITEME switchLedgers(currentClosed, consenus, slNETJUMP);
// Function to call Ledger::switchPreviousLedger
switchLastClosedLedger(consensus);
}
if (mMode == omCONNECTED)
@@ -278,3 +277,11 @@ void NetworkOPs::checkState()
setStateTimer(10);
}
void NetworkOPs::switchLastClosedLedger(Ledger::pointer newLedger)
{ // set the newledger as our last closed ledger
// FIXME: Must recover transactions
Ledger::pointer openLedger = boost::make_shared<Ledger>(newLedger);
theApp->getMasterLedger().switchLedgers(newLedger, openLedger);
// FIXME: Set close timer
}