mirror of
https://github.com/Xahau/xahaud.git
synced 2025-11-28 06:25:49 +00:00
.
This commit is contained in:
@@ -11,12 +11,12 @@ void LedgerHistory::load()
|
||||
|
||||
}
|
||||
|
||||
bool LedgerHistory::loadLedger(uint64 index)
|
||||
bool LedgerHistory::loadLedger(uint32 index)
|
||||
{
|
||||
Ledger::pointer ledger(new Ledger(index));
|
||||
if(ledger->load(theConfig.HISTORY_DIR))
|
||||
{
|
||||
mLedgers[index]=ledger;
|
||||
mAcceptedLedgers[index]=ledger;
|
||||
}
|
||||
return(false);
|
||||
}
|
||||
@@ -24,16 +24,16 @@ bool LedgerHistory::loadLedger(uint64 index)
|
||||
// this will see if the ledger is in memory
|
||||
// if not it will check disk and load it
|
||||
// if not it will return NULL
|
||||
Ledger::pointer LedgerHistory::getLedger(uint64 index)
|
||||
Ledger::pointer LedgerHistory::getLedger(uint32 index)
|
||||
{
|
||||
if(mLedgers.count(index))
|
||||
return(mLedgers[index]);
|
||||
if(loadLedger(index)) return(mLedgers[index]);
|
||||
if(mAcceptedLedgers.count(index))
|
||||
return(mAcceptedLedgers[index]);
|
||||
if(loadLedger(index)) return(mAcceptedLedgers[index]);
|
||||
return(Ledger::pointer());
|
||||
}
|
||||
|
||||
void LedgerHistory::addLedger(Ledger::pointer ledger)
|
||||
{
|
||||
mLedgers[ledger->getIndex()]=ledger;
|
||||
mAcceptedLedgers[ledger->getIndex()]=ledger;
|
||||
ledger->save(theConfig.HISTORY_DIR);
|
||||
}
|
||||
Reference in New Issue
Block a user