36 #include <boost/program_options/options_description.hpp> 37 #include <boost/program_options/variables_map.hpp> 38 #include <boost/interprocess/sync/file_lock.hpp> 42 #include "storages/portable_storage_template_helper.h" 133 bool handle_incoming_txs(
const std::list<blobdata>& tx_blobs, std::vector<tx_verification_context>& tvc,
bool keeped_by_block,
bool relayed,
bool do_not_relay);
156 bool prepare_handle_incoming_blocks(
const std::list<block_complete_entry> &
blocks);
163 bool cleanup_handle_incoming_blocks(
bool force_sync =
false);
172 bool check_incoming_block_size(
const blobdata& block_blob)
const;
194 virtual bool handle_block_found(
block&
b);
231 static void init_options(boost::program_options::options_description& desc);
251 bool set_genesis_block(
const block&
b);
265 void test_drop_download();
272 void test_drop_download_height(uint64_t
height);
279 bool get_test_drop_download()
const;
289 bool get_test_drop_download_height()
const;
296 uint64_t get_current_blockchain_height()
const;
313 bool get_blocks(uint64_t start_offset,
size_t count, std::list<std::pair<cryptonote::blobdata,block>>&
blocks, std::list<cryptonote::blobdata>& txs)
const;
320 bool get_blocks(uint64_t start_offset,
size_t count, std::list<std::pair<cryptonote::blobdata,block>>&
blocks)
const;
327 bool get_blocks(uint64_t start_offset,
size_t count, std::list<block>&
blocks)
const;
334 template<
class t_
ids_container,
class t_blocks_container,
class t_missed_container>
335 bool get_blocks(
const t_ids_container& block_ids, t_blocks_container&
blocks, t_missed_container& missed_bs)
const 337 return m_blockchain_storage.get_blocks(block_ids,
blocks, missed_bs);
352 bool get_transactions(
const std::vector<crypto::hash>& txs_ids, std::list<cryptonote::blobdata>& txs, std::list<crypto::hash>& missed_txs)
const;
359 bool get_transactions(
const std::vector<crypto::hash>& txs_ids, std::list<transaction>& txs, std::list<crypto::hash>& missed_txs)
const;
366 bool get_block_by_hash(
const crypto::hash &h,
block &blk,
bool *orphan = NULL)
const;
373 bool get_alternative_blocks(std::list<block>&
blocks)
const;
380 size_t get_alternative_blocks_count()
const;
401 void set_checkpoints_file_path(
const std::string& path);
408 void set_enforce_dns_checkpoints(
bool enforce_dns);
429 bool get_pool_transactions(std::list<transaction>& txs)
const;
436 bool get_txpool_backlog(std::vector<tx_backlog_entry>& backlog)
const;
443 bool get_pool_transaction_hashes(std::vector<crypto::hash>& txs)
const;
450 bool get_pool_transaction_stats(
struct txpool_stats& stats)
const;
464 bool get_pool_transactions_and_spent_keys_info(std::vector<tx_info>& tx_infos, std::vector<spent_key_image_info>& key_image_infos)
const;
471 size_t get_pool_transactions_count()
const;
478 size_t get_blockchain_total_transactions()
const;
492 bool get_short_chain_history(std::list<crypto::hash>& ids)
const;
506 bool find_blockchain_supplement(
const uint64_t req_start_block,
const std::list<crypto::hash>& qblock_ids, std::list<std::pair<
cryptonote::blobdata, std::list<cryptonote::blobdata> > >&
blocks, uint64_t& total_height, uint64_t& start_height,
size_t max_count)
const;
522 bool get_tx_outputs_gindexs(
const crypto::hash& tx_id, std::vector<uint64_t>& indexs)
const;
594 void print_blockchain(uint64_t start_index, uint64_t end_index)
const;
601 void print_blockchain_index()
const;
608 std::string print_pool(
bool short_format)
const;
615 void print_blockchain_outs(
const std::string& file);
622 void on_synchronized();
629 void safesyncmode(
const bool onoff);
636 void set_target_blockchain_height(uint64_t target_blockchain_height);
643 uint64_t get_target_blockchain_height()
const;
650 uint8_t get_ideal_hard_fork_version(uint64_t
height)
const;
657 uint8_t get_hard_fork_version(uint64_t
height)
const;
663 std::time_t get_start_time()
const;
675 bool update_checkpoints();
683 void graceful_exit();
709 bool are_key_images_spent(
const std::vector<crypto::key_image>& key_im, std::vector<bool> &spent)
const;
716 size_t get_block_sync_size(uint64_t
height)
const;
723 std::pair<uint64_t, uint64_t> get_coinbase_tx_sum(
const uint64_t start_offset,
const size_t count);
784 bool load_state_data();
821 bool check_tx_semantic(
const transaction& tx,
bool keeped_by_block)
const;
833 bool update_miner_block_template();
842 bool handle_command_line(
const boost::program_options::variables_map& vm);
851 bool check_tx_inputs_keyimages_diff(
const transaction& tx)
const;
860 bool check_tx_inputs_ring_members_diff(
const transaction& tx)
const;
870 bool check_tx_inputs_keyimages_domain(
const transaction& tx)
const;
882 bool check_fork_time();
889 bool relay_txpool_transactions();
898 bool m_test_drop_download =
true;
900 uint64_t m_test_drop_download_height = 0;
941 std::unordered_set<crypto::hash> bad_semantics_txes[2];
951 } check_updates_level;
Definition: cryptonote_protocol_defs.h:165
Blockchain m_blockchain_storage
Blockchain instance.
Definition: cryptonote_core.h:903
std::string m_config_folder
folder to look in for configs and other files
Definition: cryptonote_core.h:913
PUSH_WARNINGS
Definition: hash-ops.h:54
Definition: core_rpc_server_commands_defs.h:339
epee::math_helper::once_a_time_seconds< 60 *60 *12, true > m_check_updates_interval
interval for checking for new versions
Definition: cryptonote_core.h:920
void init_options(boost::program_options::options_description &hidden_options, boost::program_options::options_description &normal_options)
Definition: posix_daemonizer.inl:57
std::atomic_flag m_checkpoints_updating
set if checkpoints are currently updating to avoid multiple threads attempting to update at once
Definition: cryptonote_core.h:934
Definition: cryptonote_protocol_handler_common.h:52
Definition: cryptonote_basic.h:372
time_t m_last_json_checkpoints_update
time when json checkpoints were last updated
Definition: cryptonote_core.h:932
uint64_t height
Definition: blockchain.cpp:87
time_t start_time
Definition: cryptonote_core.h:939
account_public_address m_miner_address
address to mine to (for miner instance)
Definition: cryptonote_core.h:911
Definition: core_rpc_server_commands_defs.h:389
time_t m_last_dns_checkpoints_update
time when dns checkpoints were last updated
Definition: cryptonote_core.h:931
void disable_dns_checkpoints(bool disable=true)
set whether or not to enable or disable DNS checkpoints
Definition: cryptonote_core.h:415
Definition: connection_context.h:41
Definition: verification_context.h:54
Definition: cryptonote_stat_info.h:38
bool get_testnet() const
get whether we're on testnet or not
Definition: cryptonote_core.h:730
bool m_fluffy_blocks_enabled
Definition: cryptonote_core.h:957
std::atomic< bool > m_starter_message_showed
has the "daemon will sync now" message been shown?
Definition: cryptonote_core.h:922
Definition: cryptonote_core.h:948
tools::thread_group m_threadpool
Definition: cryptonote_core.h:944
Holds cryptonote related classes and helpers.
Definition: db_bdb.cpp:225
Definition: verification_context.h:38
Definition: core_rpc_server_commands_defs.h:310
epee::math_helper::once_a_time_seconds< 60 *60 *2, true > m_fork_moaner
interval for checking HardFork status
Definition: cryptonote_core.h:918
tx_memory_pool m_mempool
transaction pool instance
Definition: cryptonote_core.h:902
Definition: cryptonote_core.h:949
epee::math_helper::once_a_time_seconds< 60 *60 *12, false > m_store_blockchain_interval
interval for manual storing of Blockchain, if enabled
Definition: cryptonote_core.h:917
size_t m_last_update_length
Definition: cryptonote_core.h:954
bool m_disable_dns_checkpoints
Definition: cryptonote_core.h:935
i_cryptonote_protocol * get_protocol()
get the cryptonote protocol instance
Definition: cryptonote_core.h:179
Definition: cryptonote_core.h:950
Definition: cryptonote_protocol_defs.h:181
handles core cryptonote functionality
Definition: cryptonote_core.h:73
bool fluffy_blocks_enabled() const
get whether fluffy blocks are enabled
Definition: cryptonote_core.h:737
DISABLE_VS_WARNINGS(4244 4345 4503) namespace cryptonote
Definition: tx_pool.cpp:53
int b
Definition: base.py:1
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
Definition: cryptonote_core.h:335
boost::mutex bad_semantics_txes_lock
Definition: cryptonote_core.h:942
std::string m_checkpoints_path
path to json checkpoints file
Definition: cryptonote_core.h:930
epee::critical_section m_incoming_tx_lock
incoming transaction lock
Definition: cryptonote_core.h:907
bool m_testnet
are we on testnet?
Definition: cryptonote_core.h:926
boost::mutex m_update_mutex
Definition: cryptonote_core.h:955
cryptonote_protocol_stub m_protocol_stub
cryptonote protocol stub instance
Definition: cryptonote_core.h:915
Definition: cryptonote_core.h:58
uint64_t m_target_blockchain_height
blockchain height target
Definition: cryptonote_core.h:924
const Blockchain & get_blockchain_storage() const
gets the Blockchain instance (const)
Definition: cryptonote_core.h:587
Transaction pool, handles transactions which are not part of a block.
Definition: tx_pool.h:93
std::string blobdata
Definition: blobdatatype.h:36
#define blocks
Definition: sha512-hash.c:11
Definition: core_rpc_server_commands_defs.h:1113
Definition: core_rpc_server_commands_defs.h:363
miner & get_miner()
gets the miner instance
Definition: cryptonote_core.h:214
Definition: cryptonote_core.h:947
Definition: cryptonote_basic.h:406
Blockchain & get_blockchain_storage()
gets the Blockchain instance
Definition: cryptonote_core.h:580
std::uint64_t difficulty_type
Definition: difficulty.h:41
size_t block_sync_size
Definition: cryptonote_core.h:937
POD_CLASS key_image
Definition: crypto.h:86
const miner & get_miner() const
gets the miner instance (const)
Definition: cryptonote_core.h:221
Definition: core_rpc_server_commands_defs.h:461
Definition: cryptonote_protocol_defs.h:231
miner m_miner
miner instance
Definition: cryptonote_core.h:910
tools::download_async_handle m_update_download
Definition: cryptonote_core.h:953
POD_CLASS hash
Definition: hash.h:46
i_cryptonote_protocol * m_pprotocol
cryptonote protocol instance
Definition: cryptonote_core.h:905
A container for blockchain checkpoints.
Definition: checkpoints.h:52
bool m_fakechain
are we using a fake chain (for testing purposes)?
Definition: cryptonote_core.h:928
const std::pair< uint8_t, uint64_t > * hard_forks
Definition: cryptonote_core.h:59
epee::math_helper::once_a_time_seconds< 60 *2, false > m_txpool_auto_relayer
interval for checking re-relaying txpool transactions
Definition: cryptonote_core.h:919
Definition: cryptonote_basic.h:188
Definition: cryptonote_protocol_handler_common.h:42
Definition: core_rpc_server_commands_defs.h:443
Definition: blockchain.h:78