Electroneum
Loading...
Searching...
No Matches
blockchain.cpp File Reference
#include <algorithm>
#include <cstdio>
#include <boost/filesystem.hpp>
#include <boost/range/adaptor/reversed.hpp>
#include "include_base_utils.h"
#include "cryptonote_basic/cryptonote_basic_impl.h"
#include "tx_pool.h"
#include "blockchain.h"
#include "blockchain_db/blockchain_db.h"
#include "cryptonote_basic/cryptonote_boost_serialization.h"
#include "cryptonote_config.h"
#include "cryptonote_basic/miner.h"
#include "misc_language.h"
#include "profile_tools.h"
#include "file_io_utils.h"
#include "int-util.h"
#include "common/threadpool.h"
#include "common/boost_serialization_helper.h"
#include "warnings.h"
#include "crypto/hash.h"
#include "cryptonote_core.h"
#include "ringct/rctSigs.h"
#include "common/perf_timer.h"
#include "common/notify.h"
#include "common/varint.h"
#include "common/pruning.h"
Include dependency graph for blockchain.cpp:

Go to the source code of this file.

Namespaces

namespace  cryptonote
 Holds cryptonote related classes and helpers.

Macros

#define ELECTRONEUM_DEFAULT_LOG_CATEGORY   "blockchain"
#define FIND_BLOCKCHAIN_SUPPLEMENT_MAX_SIZE   (100*1024*1024)
#define FIND_BLOCKCHAIN_SUPPLEMENT_MAX_SIZE   (100*1024*1024)
#define MERROR_VER(x)
#define BLOCK_REWARD_OVERESTIMATE   (10 * 1000000000000)
#define SCAN_TABLE_QUIT(m)

Functions

void slow_hash_allocate_state ()
void slow_hash_free_state ()
template<typename T>
void reserve_container (std::vector< T > &v, size_t N)
template<typename T>
void reserve_container (std::list< T > &v, size_t N)
size_t get_transaction_version (const cryptonote::blobdata &bd)
template<class t_pod_type>
std::string pod_to_hex (const t_pod_type &s)

Macro Definition Documentation

◆ BLOCK_REWARD_OVERESTIMATE

#define BLOCK_REWARD_OVERESTIMATE   (10 * 1000000000000)

Definition at line 87 of file blockchain.cpp.

◆ ELECTRONEUM_DEFAULT_LOG_CATEGORY

#define ELECTRONEUM_DEFAULT_LOG_CATEGORY   "blockchain"

Definition at line 61 of file blockchain.cpp.

◆ FIND_BLOCKCHAIN_SUPPLEMENT_MAX_SIZE [1/2]

#define FIND_BLOCKCHAIN_SUPPLEMENT_MAX_SIZE   (100*1024*1024)

Definition at line 63 of file blockchain.cpp.

◆ FIND_BLOCKCHAIN_SUPPLEMENT_MAX_SIZE [2/2]

#define FIND_BLOCKCHAIN_SUPPLEMENT_MAX_SIZE   (100*1024*1024)

Definition at line 63 of file blockchain.cpp.

◆ MERROR_VER

#define MERROR_VER ( x)
Value:
MCERROR("verify", x)
#define MCERROR(cat, x)
Definition misc_log_ex.h:51

Definition at line 84 of file blockchain.cpp.

◆ SCAN_TABLE_QUIT

#define SCAN_TABLE_QUIT ( m)
Value:
do { \
MERROR_VER(m) ;\
m_scan_table.clear(); \
return false; \
} while(0); \

Function Documentation

◆ get_transaction_version()

size_t get_transaction_version ( const cryptonote::blobdata & bd)

Definition at line 2488 of file blockchain.cpp.

2489{
2490 size_t version;
2491 const char* begin = static_cast<const char*>(bd.data());
2492 const char* end = begin + bd.size();
2493 int read = tools::read_varint(begin, end, version);
2494 if (read <= 0)
2495 throw std::runtime_error("Internal error getting transaction version");
2496 return version;
2497}
uint8_t version
std::enable_if< std::is_integral< T >::value &&std::is_unsigned< T >::value &&0<=bits &&bits<=std::numeric_limits< T >::digits, int >::type read_varint(InputIt &&first, InputIt &&last, T &write)
reads in the varint that is pointed to by InputIt into write
Definition varint.h:95
Here is the call graph for this function:

◆ pod_to_hex()

template<class t_pod_type>
std::string epee::string_tools::pod_to_hex ( const t_pod_type & s)

Definition at line 317 of file string_tools.h.

318 {
319 static_assert(std::is_standard_layout<t_pod_type>(), "expected standard layout type");
320 return to_hex::string(as_byte_span(s));
321 }
span< const std::uint8_t > as_byte_span(const T &src) noexcept
Definition span.h:153

◆ reserve_container() [1/2]

template<typename T>
void reserve_container ( std::list< T > & v,
size_t N )

Definition at line 2422 of file blockchain.cpp.

2422{ }

◆ reserve_container() [2/2]

template<typename T>
void reserve_container ( std::vector< T > & v,
size_t N )

Definition at line 2421 of file blockchain.cpp.

2421{ v.reserve(N); }
Here is the caller graph for this function:

◆ slow_hash_allocate_state()

void slow_hash_allocate_state ( )

◆ slow_hash_free_state()

void slow_hash_free_state ( )

Variable Documentation

◆ height

uint64_t height

Definition at line 91 of file blockchain.cpp.

◆ threshold

uint8_t threshold

Definition at line 92 of file blockchain.cpp.

◆ time

time_t time

Definition at line 93 of file blockchain.cpp.

◆ version

uint8_t version

Definition at line 90 of file blockchain.cpp.