20#ifndef RIPPLE_APP_PENDINGSAVES_H_INCLUDED
21#define RIPPLE_APP_PENDINGSAVES_H_INCLUDED
23#include <xrpl/protocol/Protocol.h>
56 auto it =
map_.find(seq);
58 if ((it ==
map_.end()) || it->second)
105 auto it =
map_.find(seq);
107 if (it ==
map_.end())
109 map_.emplace(seq,
false);
Keeps track of which ledgers haven't been fully saved.
void finishWork(LedgerIndex seq)
Finish working on a ledger.
std::map< LedgerIndex, bool > getSnapshot() const
Get a snapshot of the pending saves.
bool startWork(LedgerIndex seq)
Start working on a ledger.
bool shouldWork(LedgerIndex seq, bool isSynchronous)
Check if a ledger should be dispatched.
std::map< LedgerIndex, bool > map_
std::condition_variable await_
bool pending(LedgerIndex seq)
Return true if a ledger is in the progress of being saved.
Use hash_* containers for keys that do not need a cryptographically secure hashing algorithm.