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);
460 bool get_pool_transactions(std::vector<transaction>& txs,
bool include_unrelayed_txes =
true)
const;
467 bool get_txpool_backlog(std::vector<tx_backlog_entry>& backlog)
const;
475 bool get_pool_transaction_hashes(std::vector<crypto::hash>& txs,
bool include_unrelayed_txes =
true)
const;
483 bool get_pool_transaction_stats(
struct txpool_stats& stats,
bool include_unrelayed_txes =
true)
const;
498 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;
512 size_t get_pool_transactions_count()
const;
519 size_t get_blockchain_total_transactions()
const;
533 bool get_short_chain_history(std::list<crypto::hash>& ids)
const;
547 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;
563 bool get_tx_outputs_gindexs(
const crypto::hash& tx_id, std::vector<uint64_t>& indexs)
const;
564 bool get_tx_outputs_gindexs(
const crypto::hash& tx_id,
size_t n_txes, std::vector<std::vector<uint64_t>>& indexs)
const;
641 void on_synchronized();
648 void safesyncmode(
const bool onoff);
655 void set_target_blockchain_height(
uint64_t target_blockchain_height);
662 uint64_t get_target_blockchain_height()
const;
669 uint8_t get_ideal_hard_fork_version()
const;
696 std::time_t get_start_time()
const;
708 bool update_checkpoints();
730 bool isValidatorsListValid();
738 void graceful_exit();
764 bool are_key_images_spent(
const std::vector<crypto::key_image>& key_im, std::vector<bool> &spent)
const;
776 bool utxo_nonexistant(
const std::vector<txin_to_key_public>& public_outputs, std::vector<bool> &spent)
const;
786 bool are_key_images_spent_in_pool(
const std::vector<crypto::key_image>& key_im, std::vector<bool> &spent)
const;
800 std::pair<uint64_t, uint64_t> get_coinbase_tx_sum(
const uint64_t start_offset,
const size_t count);
852 uint32_t get_blockchain_pruning_seed()
const;
861 bool prune_blockchain(
uint32_t pruning_seed = 0);
868 bool update_blockchain_pruning();
875 bool check_blockchain_pruning();
886 std::vector<std::string> generate_ed25519_keypair();
892 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);
894 std::vector<address_txs> get_addr_tx_batch_history(
const address_parse_info &addr,
const uint64_t &start_tx_id = 0,
const uint64_t &batch_size = 100,
bool desc =
false);
941 bool load_state_data();
978 bool check_tx_semantic(
const transaction& tx,
bool keeped_by_block)
const;
984 bool handle_incoming_tx_accumulated_batch(std::vector<tx_verification_batch_info> &tx_info,
bool keeped_by_block);
993 bool update_miner_block_template();
1002 bool handle_command_line(
const boost::program_options::variables_map& vm);
1011 bool check_tx_inputs_keyimages_diff(
const transaction& tx)
const;
1013 bool check_tx_inputs_utxos_diff(
const transaction& tx)
const;
1022 bool check_tx_inputs_ring_members_diff(
const transaction& tx)
const;
1032 bool check_tx_inputs_keyimages_domain(
const transaction& tx)
const;
1044 bool check_fork_time();
1051 bool relay_txpool_transactions();
1065 bool check_disk_space();
1072 bool check_block_rate();
1074 bool m_test_drop_download =
true;
1076 uint64_t m_test_drop_download_height = 0;
1078 tx_memory_pool m_mempool;
1079 Blockchain m_blockchain_storage;
1081 i_cryptonote_protocol* m_pprotocol;
1087 account_public_address m_miner_address;
1091 cryptonote_protocol_stub m_protocol_stub;
1102 std::atomic<bool> m_starter_message_showed;
1104 uint64_t m_target_blockchain_height;
1108 std::atomic<bool> m_update_available;
1111 time_t m_last_dns_checkpoints_update;
1112 time_t m_last_json_checkpoints_update;
1114 std::atomic_flag m_checkpoints_updating;
1115 bool m_disable_dns_checkpoints;
1117 size_t block_sync_size;
1121 std::unordered_set<crypto::hash> bad_semantics_txes[2];
1122 boost::mutex bad_semantics_txes_lock;
1126 std::unique_ptr<electroneum::basic::Validators> m_validators;
1133 } check_updates_level;
1136 size_t m_last_update_length;
1137 boost::mutex m_update_mutex;
1139 bool m_fluffy_blocks_enabled;
1141 bool m_pad_transactions;
1143 std::shared_ptr<tools::Notify> m_block_rate_notify;
1145 bool m_fallback_to_pow;
1147 uint64_t m_fallback_to_pow_checkpoint_height;
void init_options(boost::program_options::options_description &hidden_options, boost::program_options::options_description &normal_options)
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.
const command_line::arg_descriptor< bool, false > arg_stagenet_on
void disable_dns_checkpoints(bool disable=true)
set whether or not to enable or disable DNS checkpoints
network_type get_nettype() const
get the network type we're on
uint64_t get_balance(const cryptonote::account_base &addr, const std::vector< cryptonote::block > &blockchain, const map_hash2tx_t &mtx)
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< difficulty_type > arg_fixed_difficulty
mdb_size_t count(MDB_cursor *cur)
const command_line::arg_descriptor< bool, false > arg_testnet_on
i_cryptonote_protocol * get_protocol()
get the cryptonote protocol instance
handles core cryptonote functionality
bool fluffy_blocks_enabled() const
get whether fluffy blocks are enabled
unsigned __int64 uint64_t
const command_line::arg_descriptor< std::string, false, true, 2 > arg_data_dir
bool is_update_available() const
check whether an update is known to be available or not
std::unique_ptr< void, terminate > context
Unique ZMQ context handle, calls zmq_term on destruction.
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
version
Supported socks variants.
const Blockchain & get_blockchain_storage() const
gets the Blockchain instance (const)
const command_line::arg_descriptor< bool > arg_offline
bool offline() const
get whether the core is running offline
miner & get_miner()
gets the miner instance
Blockchain & get_blockchain_storage()
gets the Blockchain instance
const command_line::arg_descriptor< bool > arg_fallback_to_pow
boost::multiprecision::uint128_t difficulty_type
const miner & get_miner() const
gets the miner instance (const)
const command_line::arg_descriptor< bool > arg_skip_block_sig_verification
const command_line::arg_descriptor< bool > arg_regtest_on
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)
DISABLE_VS_WARNINGS(4244 4345 4503) using namespace crypto
const command_line::arg_descriptor< uint64_t > arg_fallback_to_pow_checkpoint_height
A container for blockchain checkpoints.
const command_line::arg_descriptor< std::string > arg_fallback_to_pow_checkpoint_hash
std::string sign_message(const std::string &message, const std::string &privateKey)
bool pad_transactions() const
get whether transaction relay should be padded
const std::pair< uint8_t, uint64_t > * hard_forks
const size_t long_term_block_weight_window