36 #include <boost/program_options/options_description.hpp>
37 #include <boost/program_options/variables_map.hpp>
145 bool handle_incoming_txs(
const std::vector<blobdata>& tx_blobs, std::vector<tx_verification_context>& tvc,
bool keeped_by_block,
bool relayed,
bool do_not_relay);
169 bool prepare_handle_incoming_blocks(
const std::vector<block_complete_entry> &blocks_entry, std::vector<block> &
blocks);
176 bool cleanup_handle_incoming_blocks(
bool force_sync =
false);
185 bool check_incoming_block_size(
const blobdata& block_blob)
const;
246 static void init_options(boost::program_options::options_description& desc);
267 bool set_genesis_block(
const block& b);
281 void test_drop_download();
295 bool get_test_drop_download()
const;
305 bool get_test_drop_download_height()
const;
312 uint64_t get_current_blockchain_height()
const;
327 bool get_blocks(
uint64_t start_offset,
size_t count, std::vector<std::pair<cryptonote::blobdata,block>>&
blocks, std::vector<cryptonote::blobdata>& txs)
const;
334 bool get_blocks(
uint64_t start_offset,
size_t count, std::vector<std::pair<cryptonote::blobdata,block>>&
blocks)
const;
348 template<
class t_
ids_container,
class t_blocks_container,
class t_missed_container>
349 bool get_blocks(
const t_ids_container& block_ids, t_blocks_container&
blocks, t_missed_container& missed_bs)
const
351 return m_blockchain_storage.get_blocks(block_ids,
blocks, missed_bs);
366 bool get_transactions(
const std::vector<crypto::hash>& txs_ids, std::vector<cryptonote::blobdata>& txs, std::vector<crypto::hash>& missed_txs)
const;
373 bool get_split_transactions_blobs(
const std::vector<crypto::hash>& txs_ids, std::vector<std::tuple<crypto::hash, cryptonote::blobdata, crypto::hash, cryptonote::blobdata>>& txs, std::vector<crypto::hash>& missed_txs)
const;
380 bool get_transactions(
const std::vector<crypto::hash>& txs_ids, std::vector<transaction>& txs, std::vector<crypto::hash>& missed_txs)
const;
387 bool get_block_by_hash(
const crypto::hash &h,
block &blk,
bool *orphan = NULL)
const;
394 bool get_alternative_blocks(std::vector<block>&
blocks)
const;
401 size_t get_alternative_blocks_count()
const;
422 void set_checkpoints_file_path(
const std::string& path);
429 void set_enforce_dns_checkpoints(
bool enforce_dns);
451 bool get_pool_transactions(std::vector<transaction>& txs,
bool include_unrelayed_txes =
true)
const;
458 bool get_txpool_backlog(std::vector<tx_backlog_entry>& backlog)
const;
466 bool get_pool_transaction_hashes(std::vector<crypto::hash>& txs,
bool include_unrelayed_txes =
true)
const;
474 bool get_pool_transaction_stats(
struct txpool_stats& stats,
bool include_unrelayed_txes =
true)
const;
489 bool get_pool_transactions_and_spent_keys_info(std::vector<tx_info>& tx_infos, std::vector<spent_key_image_info>& key_image_infos,
bool include_unrelayed_txes =
true)
const;
503 size_t get_pool_transactions_count()
const;
510 size_t get_blockchain_total_transactions()
const;
524 bool get_short_chain_history(std::list<crypto::hash>& ids)
const;
538 bool find_blockchain_supplement(
const uint64_t req_start_block,
const std::list<crypto::hash>& qblock_ids, std::vector<std::pair<std::pair<cryptonote::blobdata, crypto::hash>, std::vector<std::pair<crypto::hash, cryptonote::blobdata> > > >&
blocks,
uint64_t& total_height,
uint64_t& start_height,
bool pruned,
bool get_miner_tx_hash,
size_t max_count)
const;
554 bool get_tx_outputs_gindexs(
const crypto::hash& tx_id, std::vector<uint64_t>& indexs)
const;
555 bool get_tx_outputs_gindexs(
const crypto::hash& tx_id,
size_t n_txes, std::vector<std::vector<uint64_t>>& indexs)
const;
632 void on_synchronized();
639 void safesyncmode(
const bool onoff);
646 void set_target_blockchain_height(
uint64_t target_blockchain_height);
653 uint64_t get_target_blockchain_height()
const;
660 uint8_t get_ideal_hard_fork_version()
const;
687 std::time_t get_start_time()
const;
699 bool update_checkpoints();
721 bool isValidatorsListValid();
729 void graceful_exit();
755 bool are_key_images_spent(
const std::vector<crypto::key_image>& key_im, std::vector<bool> &spent)
const;
765 bool are_key_images_spent_in_pool(
const std::vector<crypto::key_image>& key_im, std::vector<bool> &spent)
const;
779 std::pair<uint64_t, uint64_t> get_coinbase_tx_sum(
const uint64_t start_offset,
const size_t count);
831 uint32_t get_blockchain_pruning_seed()
const;
840 bool prune_blockchain(
uint32_t pruning_seed = 0);
847 bool update_blockchain_pruning();
854 bool check_blockchain_pruning();
865 std::vector<std::string> generate_ed25519_keypair();
871 std::vector<address_outputs> get_address_batch_history(
const address_parse_info &addr,
const uint64_t &start_tx_id = 0,
const uint64_t &batch_size = 100,
bool desc =
false);
918 bool load_state_data();
955 bool check_tx_semantic(
const transaction& tx,
bool keeped_by_block)
const;
961 bool handle_incoming_tx_accumulated_batch(std::vector<tx_verification_batch_info> &tx_info,
bool keeped_by_block);
970 bool update_miner_block_template();
979 bool handle_command_line(
const boost::program_options::variables_map& vm);
988 bool check_tx_inputs_keyimages_diff(
const transaction& tx)
const;
990 bool check_tx_inputs_utxos_diff(
const transaction& tx)
const;
999 bool check_tx_inputs_ring_members_diff(
const transaction& tx)
const;
1009 bool check_tx_inputs_keyimages_domain(
const transaction& tx)
const;
1021 bool check_fork_time();
1028 bool relay_txpool_transactions();
1042 bool check_disk_space();
1049 bool check_block_rate();
1051 bool m_test_drop_download =
true;
1053 uint64_t m_test_drop_download_height = 0;
1055 tx_memory_pool m_mempool;
1056 Blockchain m_blockchain_storage;
1058 i_cryptonote_protocol* m_pprotocol;
1064 account_public_address m_miner_address;
1068 cryptonote_protocol_stub m_protocol_stub;
1079 std::atomic<bool> m_starter_message_showed;
1081 uint64_t m_target_blockchain_height;
1085 std::atomic<bool> m_update_available;
1088 time_t m_last_dns_checkpoints_update;
1089 time_t m_last_json_checkpoints_update;
1091 std::atomic_flag m_checkpoints_updating;
1092 bool m_disable_dns_checkpoints;
1094 size_t block_sync_size;
1098 std::unordered_set<crypto::hash> bad_semantics_txes[2];
1099 boost::mutex bad_semantics_txes_lock;
1103 std::unique_ptr<electroneum::basic::Validators> m_validators;
1110 } check_updates_level;
1113 size_t m_last_update_length;
1114 boost::mutex m_update_mutex;
1116 bool m_fluffy_blocks_enabled;
1118 bool m_pad_transactions;
1120 std::shared_ptr<tools::Notify> m_block_rate_notify;
1122 bool m_fallback_to_pow;
1124 uint64_t m_fallback_to_pow_checkpoint_height;
uint64_t get_balance(const cryptonote::account_base &addr, const std::vector< cryptonote::block > &blockchain, const map_hash2tx_t &mtx)
A container for blockchain checkpoints.
handles core cryptonote functionality
bool fluffy_blocks_enabled() const
get whether fluffy blocks are enabled
bool is_update_available() const
check whether an update is known to be available or not
Blockchain & get_blockchain_storage()
gets the Blockchain instance
const miner & get_miner() const
gets the miner instance (const)
bool offline() const
get whether the core is running offline
network_type get_nettype() const
get the network type we're on
i_cryptonote_protocol * get_protocol()
get the cryptonote protocol instance
void disable_dns_checkpoints(bool disable=true)
set whether or not to enable or disable DNS checkpoints
miner & get_miner()
gets the miner instance
bool get_blocks(const t_ids_container &block_ids, t_blocks_container &blocks, t_missed_container &missed_bs) const
gets blocks based on a list of block hashes
bool pad_transactions() const
get whether transaction relay should be padded
const Blockchain & get_blockchain_storage() const
gets the Blockchain instance (const)
std::string sign_message(const std::string &message, const std::string &privateKey)
std::unordered_map< crypto::key_image, std::vector< crypto::hash > > key_images_with_tx_hashes
Holds cryptonote related classes and helpers.
const command_line::arg_descriptor< std::string, false, true, 2 > arg_data_dir
boost::multiprecision::uint128_t difficulty_type
const command_line::arg_descriptor< bool > arg_regtest_on
const command_line::arg_descriptor< bool > arg_offline
const command_line::arg_descriptor< difficulty_type > arg_fixed_difficulty
const command_line::arg_descriptor< bool > arg_fallback_to_pow
const command_line::arg_descriptor< bool, false > arg_testnet_on
const command_line::arg_descriptor< std::string > arg_fallback_to_pow_checkpoint_hash
const command_line::arg_descriptor< bool, false > arg_stagenet_on
const command_line::arg_descriptor< uint64_t > arg_fallback_to_pow_checkpoint_height
const command_line::arg_descriptor< bool > arg_skip_block_sig_verification
const command_line::arg_descriptor< size_t > arg_block_download_max_size
std::function< const epee::span< const unsigned char >cryptonote::network_type network)> GetCheckpointsCallback
Callback routine that returns checkpoints data for specific network type.
void init_options(boost::program_options::options_description &hidden_options, boost::program_options::options_description &normal_options)
mdb_size_t count(MDB_cursor *cur)
version
Supported socks variants.
std::unique_ptr< void, terminate > context
Unique ZMQ context handle, calls zmq_term on destruction.
bool get_output_distribution(uint64_t amount, uint64_t from, uint64_t to, uint64_t &start_height, std::vector< uint64_t > &distribution, uint64_t &base)
unsigned __int64 uint64_t
const size_t long_term_block_weight_window
const std::pair< uint8_t, uint64_t > * hard_forks
DISABLE_VS_WARNINGS(4244 4345 4503) using namespace crypto