Electroneum
Macros | Functions | Variables
blockchain_prune.cpp File Reference
#include <array>
#include <lmdb.h>
#include <boost/algorithm/string.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 "blockchain_db/db_types.h"
#include "version.h"
Include dependency graph for blockchain_prune.cpp:

Macros

#define ELECTRONEUM_DEFAULT_LOG_CATEGORY   "bcutil"
 
#define MDB_val_set(var, val)   MDB_val var = {sizeof(val), (void *)&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

◆ ELECTRONEUM_DEFAULT_LOG_CATEGORY

#define ELECTRONEUM_DEFAULT_LOG_CATEGORY   "bcutil"

◆ MDB_val_set

#define MDB_val_set (   var,
  val 
)    MDB_val var = {sizeof(val), (void *)&val}

Function Documentation

◆ add_size()

static void add_size ( MDB_env *  env,
uint64_t  bytes 
)
static

◆ check_resize()

static void check_resize ( MDB_env *  env,
size_t  bytes 
)
static

◆ close()

static void close ( MDB_env *  env)
static

◆ copy_table()

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

◆ is_v1_tx()

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

◆ main()

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

◆ open()

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

◆ parse_db_sync_mode()

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

◆ prune()

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

◆ replace_file()

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

◆ resize_point()

static 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