xrpld
Toggle main menu visibility
Loading...
Searching...
No Matches
include
xrpl
server
State.h
1
#pragma once
2
3
#include <xrpl/protocol/Protocol.h>
4
#include <xrpl/rdb/DatabaseCon.h>
5
#include <xrpl/rdb/SociDB.h>
6
7
#include <
string
>
8
9
namespace
xrpl
{
10
11
struct
SavedState
12
{
13
std::string
writableDb
;
14
std::string
archiveDb
;
15
LedgerIndex
lastRotated
{};
16
};
17
24
void
25
initStateDB
(soci::session& session, BasicConfig
const
& config,
std::string
const
& dbName);
26
32
LedgerIndex
33
getCanDelete
(soci::session& session);
34
41
LedgerIndex
42
setCanDelete
(soci::session& session,
LedgerIndex
canDelete);
43
50
SavedState
51
getSavedState
(soci::session& session);
52
60
void
61
setSavedState
(soci::session& session, SavedState
const
& state);
62
68
void
69
setLastRotated
(soci::session& session,
LedgerIndex
seq);
70
71
}
// namespace xrpl
std::string
xrpl
Use hash_* containers for keys that do not need a cryptographically secure hashing algorithm.
Definition
algorithm.h:5
xrpl::initStateDB
void initStateDB(soci::session &session, BasicConfig const &config, std::string const &dbName)
initStateDB Opens a session with the State database.
Definition
State.cpp:22
xrpl::setSavedState
void setSavedState(soci::session &session, SavedState const &state)
setSavedState Saves the given state.
Definition
State.cpp:99
xrpl::LedgerIndex
std::uint32_t LedgerIndex
A ledger index.
Definition
Protocol.h:382
xrpl::setLastRotated
void setLastRotated(soci::session &session, LedgerIndex seq)
setLastRotated Updates the last rotated ledger sequence.
Definition
State.cpp:110
xrpl::getSavedState
SavedState getSavedState(soci::session &session)
getSavedState Returns the saved state.
Definition
State.cpp:88
xrpl::setCanDelete
LedgerIndex setCanDelete(soci::session &session, LedgerIndex canDelete)
setCanDelete Updates the ledger sequence which can be deleted.
Definition
State.cpp:80
xrpl::getCanDelete
LedgerIndex getCanDelete(soci::session &session)
getCanDelete Returns the ledger sequence which can be deleted.
Definition
State.cpp:71
string
xrpl::SavedState
Definition
State.h:12
xrpl::SavedState::writableDb
std::string writableDb
Definition
State.h:13
xrpl::SavedState::lastRotated
LedgerIndex lastRotated
Definition
State.h:15
xrpl::SavedState::archiveDb
std::string archiveDb
Definition
State.h:14
Generated by
1.17.0