mirror of
https://github.com/XRPLF/rippled.git
synced 2025-12-06 17:27:55 +00:00
Ledger switch logic.
This commit is contained in:
@@ -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
|
||||
}
|
||||
|
||||
@@ -5,6 +5,7 @@
|
||||
|
||||
#include "Transaction.h"
|
||||
#include "AccountState.h"
|
||||
#include "Ledger.h"
|
||||
|
||||
// Operations that clients may wish to perform against the network
|
||||
// Master operational handler, server sequencer, network tracker
|
||||
@@ -65,6 +66,7 @@ public:
|
||||
|
||||
// network state machine
|
||||
void checkState();
|
||||
void switchLastClosedLedger(Ledger::pointer newLedger);
|
||||
|
||||
protected:
|
||||
|
||||
|
||||
Reference in New Issue
Block a user