Monero
Loading...
Searching...
No Matches
blockchain_prune.cpp File Reference
#include <array>
#include <lmdb.h>
#include <boost/algorithm/string.hpp>
#include <boost/system/error_code.hpp>
#include <boost/filesystem.hpp>
#include "common/command_line.h"
#include "common/pruning.h"
#include "cryptonote_core/cryptonote_core.h"
#include "cryptonote_core/blockchain.h"
#include "blockchain_db/blockchain_db.h"
#include "blockchain_db/lmdb/db_lmdb.h"
#include "version.h"
Include dependency graph for blockchain_prune.cpp:

Macros

#define MONERO_DEFAULT_LOG_CATEGORY   "bcutil"
#define MDB_val_set(var, val)

Functions

static std::error_code replace_file (const boost::filesystem::path &replacement_name, const boost::filesystem::path &replaced_name)
static void open (MDB_env *&env, const boost::filesystem::path &path, uint64_t db_flags, bool readonly)
static void close (MDB_env *env)
static void add_size (MDB_env *env, uint64_t bytes)
static void check_resize (MDB_env *env, size_t bytes)
static bool resize_point (size_t nrecords, MDB_env *env, MDB_txn **txn, size_t &bytes)
static void copy_table (MDB_env *env0, MDB_env *env1, const char *table, unsigned int flags, unsigned int putflags, int(*cmp)(const MDB_val *, const MDB_val *)=0)
static bool is_v1_tx (MDB_cursor *c_txs_pruned, MDB_val *tx_id)
static void prune (MDB_env *env0, MDB_env *env1)
static bool parse_db_sync_mode (std::string db_sync_mode, uint64_t &db_flags)
int main (int argc, char *argv[])

Variables

static std::string db_path
static uint64_t records_per_sync = 128
static const size_t slack = 512 * 1024 * 1024

Macro Definition Documentation

◆ MDB_val_set

#define MDB_val_set ( var,
val )
Value:
MDB_val var = {sizeof(val), (void *)&val}
Generic structure used for passing keys and data in and out of the database.
Definition lmdb.h:286

◆ MONERO_DEFAULT_LOG_CATEGORY

#define MONERO_DEFAULT_LOG_CATEGORY   "bcutil"

Function Documentation

◆ add_size()

void add_size ( MDB_env * env,
uint64_t bytes )
static

◆ check_resize()

void check_resize ( MDB_env * env,
size_t bytes )
static

◆ close()

void close ( MDB_env * env)
static

◆ copy_table()

void copy_table ( MDB_env * env0,
MDB_env * env1,
const char * table,
unsigned int flags,
unsigned int putflags,
int(* cmp )(const MDB_val *, const MDB_val *) = 0 )
static

◆ is_v1_tx()

bool is_v1_tx ( MDB_cursor * c_txs_pruned,
MDB_val * tx_id )
static

◆ main()

int main ( int argc,
char * argv[] )

◆ open()

void open ( MDB_env *& env,
const boost::filesystem::path & path,
uint64_t db_flags,
bool readonly )
static

◆ parse_db_sync_mode()

bool parse_db_sync_mode ( std::string db_sync_mode,
uint64_t & db_flags )
static

◆ prune()

void prune ( MDB_env * env0,
MDB_env * env1 )
static

◆ replace_file()

std::error_code replace_file ( const boost::filesystem::path & replacement_name,
const boost::filesystem::path & replaced_name )
static

◆ resize_point()

bool resize_point ( size_t nrecords,
MDB_env * env,
MDB_txn ** txn,
size_t & bytes )
static

Variable Documentation

◆ db_path

std::string db_path
static

◆ records_per_sync

uint64_t records_per_sync = 128
static

◆ slack

const size_t slack = 512 * 1024 * 1024
static