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" 134 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);
157 bool prepare_handle_incoming_blocks(
const std::list<block_complete_entry> &
blocks);
164 bool cleanup_handle_incoming_blocks(
bool force_sync =
false);
173 bool check_incoming_block_size(
const blobdata& block_blob)
const;
195 virtual bool handle_block_found(
block&
b);
232 static void init_options(boost::program_options::options_description& desc);
252 bool set_genesis_block(
const block&
b);
266 void test_drop_download();
273 void test_drop_download_height(uint64_t
height);
280 bool get_test_drop_download()
const;
290 bool get_test_drop_download_height()
const;
297 uint64_t get_current_blockchain_height()
const;
314 bool get_blocks(uint64_t start_offset,
size_t count, std::list<std::pair<cryptonote::blobdata,block>>&
blocks, std::list<cryptonote::blobdata>& txs)
const;
321 bool get_blocks(uint64_t start_offset,
size_t count, std::list<std::pair<cryptonote::blobdata,block>>&
blocks)
const;
328 bool get_blocks(uint64_t start_offset,
size_t count, std::list<block>&
blocks)
const;
335 template<
class t_
ids_container,
class t_blocks_container,
class t_missed_container>
336 bool get_blocks(
const t_ids_container& block_ids, t_blocks_container&
blocks, t_missed_container& missed_bs)
const 338 return m_blockchain_storage.get_blocks(block_ids,
blocks, missed_bs);
353 bool get_transactions(
const std::vector<crypto::hash>& txs_ids, std::list<cryptonote::blobdata>& txs, std::list<crypto::hash>& missed_txs)
const;
360 bool get_transactions(
const std::vector<crypto::hash>& txs_ids, std::list<transaction>& txs, std::list<crypto::hash>& missed_txs)
const;
367 bool get_block_by_hash(
const crypto::hash &h,
block &blk,
bool *orphan = NULL)
const;
374 bool get_alternative_blocks(std::list<block>&
blocks)
const;
381 size_t get_alternative_blocks_count()
const;
402 void set_checkpoints_file_path(
const std::string& path);
409 void set_enforce_dns_checkpoints(
bool enforce_dns);
430 bool get_pool_transactions(std::list<transaction>& txs)
const;
437 bool get_txpool_backlog(std::vector<tx_backlog_entry>& backlog)
const;
444 bool get_pool_transaction_hashes(std::vector<crypto::hash>& txs)
const;
451 bool get_pool_transaction_stats(
struct txpool_stats& stats)
const;
465 bool get_pool_transactions_and_spent_keys_info(std::vector<tx_info>& tx_infos, std::vector<spent_key_image_info>& key_image_infos)
const;
472 size_t get_pool_transactions_count()
const;
479 size_t get_blockchain_total_transactions()
const;
493 bool get_short_chain_history(std::list<crypto::hash>& ids)
const;
507 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;
523 bool get_tx_outputs_gindexs(
const crypto::hash& tx_id, std::vector<uint64_t>& indexs)
const;
602 void print_blockchain(uint64_t start_index, uint64_t end_index)
const;
609 void print_blockchain_index()
const;
616 std::string print_pool(
bool short_format)
const;
623 void print_blockchain_outs(
const std::string& file);
630 void on_synchronized();
637 void safesyncmode(
const bool onoff);
644 void set_target_blockchain_height(uint64_t target_blockchain_height);
651 uint64_t get_target_blockchain_height()
const;
658 uint8_t get_ideal_hard_fork_version(uint64_t
height)
const;
665 uint8_t get_hard_fork_version(uint64_t
height)
const;
671 std::time_t get_start_time()
const;
683 bool update_checkpoints();
690 std::string get_validators_list();
705 bool isValidatorsListValid();
713 void graceful_exit();
739 bool are_key_images_spent(
const std::vector<crypto::key_image>& key_im, std::vector<bool> &spent)
const;
746 size_t get_block_sync_size(uint64_t
height)
const;
753 std::pair<uint64_t, uint64_t> get_coinbase_tx_sum(
const uint64_t start_offset,
const size_t count);
776 bool set_validator_key(std::string key);
778 std::vector<std::string> generate_ed25519_keypair();
780 std::string
sign_message(std::string sk, std::string msg);
827 bool load_state_data();
864 bool check_tx_semantic(
const transaction& tx,
bool keeped_by_block)
const;
876 bool update_miner_block_template();
885 bool handle_command_line(
const boost::program_options::variables_map& vm);
894 bool check_tx_inputs_keyimages_diff(
const transaction& tx)
const;
903 bool check_tx_inputs_ring_members_diff(
const transaction& tx)
const;
913 bool check_tx_inputs_keyimages_domain(
const transaction& tx)
const;
925 bool check_fork_time();
932 bool relay_txpool_transactions();
941 bool m_test_drop_download =
true;
943 uint64_t m_test_drop_download_height = 0;
985 std::unordered_set<crypto::hash> bad_semantics_txes[2];
997 } check_updates_level;
epee::math_helper::once_a_time_seconds< 60 *2, true > m_check_validators_interval
Definition: cryptonote_core.h:964
Definition: cryptonote_protocol_defs.h:165
Blockchain m_blockchain_storage
Blockchain instance.
Definition: cryptonote_core.h:946
std::string m_config_folder
folder to look in for configs and other files
Definition: cryptonote_core.h:956
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:963
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:978
Definition: cryptonote_protocol_handler_common.h:55
Definition: cryptonote_basic.h:382
time_t m_last_json_checkpoints_update
time when json checkpoints were last updated
Definition: cryptonote_core.h:976
uint64_t height
Definition: blockchain.cpp:87
time_t start_time
Definition: cryptonote_core.h:983
account_public_address m_miner_address
address to mine to (for miner instance)
Definition: cryptonote_core.h:954
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:975
void disable_dns_checkpoints(bool disable=true)
set whether or not to enable or disable DNS checkpoints
Definition: cryptonote_core.h:416
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:760
bool m_fluffy_blocks_enabled
Definition: cryptonote_core.h:1003
std::atomic< bool > m_starter_message_showed
has the "daemon will sync now" message been shown?
Definition: cryptonote_core.h:966
Definition: cryptonote_core.h:994
tools::thread_group m_threadpool
Definition: cryptonote_core.h:988
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:961
tx_memory_pool m_mempool
transaction pool instance
Definition: cryptonote_core.h:945
Definition: cryptonote_core.h:995
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:960
size_t m_last_update_length
Definition: cryptonote_core.h:1000
bool m_disable_dns_checkpoints
Definition: cryptonote_core.h:979
i_cryptonote_protocol * get_protocol()
get the cryptonote protocol instance
Definition: cryptonote_core.h:180
Definition: cryptonote_core.h:996
Definition: cryptonote_protocol_defs.h:181
handles core cryptonote functionality
Definition: cryptonote_core.h:74
bool fluffy_blocks_enabled() const
get whether fluffy blocks are enabled
Definition: cryptonote_core.h:767
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:336
boost::mutex bad_semantics_txes_lock
Definition: cryptonote_core.h:986
std::string m_checkpoints_path
path to json checkpoints file
Definition: cryptonote_core.h:974
epee::critical_section m_incoming_tx_lock
incoming transaction lock
Definition: cryptonote_core.h:950
bool m_testnet
are we on testnet?
Definition: cryptonote_core.h:970
boost::mutex m_update_mutex
Definition: cryptonote_core.h:1001
std::unique_ptr< electroneum::basic::Validators > m_validators
Definition: cryptonote_core.h:990
cryptonote_protocol_stub m_protocol_stub
cryptonote protocol stub instance
Definition: cryptonote_core.h:958
Definition: cryptonote_core.h:59
uint64_t m_target_blockchain_height
blockchain height target
Definition: cryptonote_core.h:968
const Blockchain & get_blockchain_storage() const
gets the Blockchain instance (const)
Definition: cryptonote_core.h:595
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:1123
Definition: core_rpc_server_commands_defs.h:363
miner & get_miner()
gets the miner instance
Definition: cryptonote_core.h:215
Definition: cryptonote_core.h:993
Definition: cryptonote_basic.h:421
Blockchain & get_blockchain_storage()
gets the Blockchain instance
Definition: cryptonote_core.h:588
internal::NamedArgWithType< char, T > arg(StringRef name, const T &arg)
Definition: format.h:3450
std::uint64_t difficulty_type
Definition: difficulty.h:41
size_t block_sync_size
Definition: cryptonote_core.h:981
POD_CLASS key_image
Definition: crypto.h:93
const miner & get_miner() const
gets the miner instance (const)
Definition: cryptonote_core.h:222
Definition: core_rpc_server_commands_defs.h:461
Definition: cryptonote_protocol_defs.h:231
list_update_outcome
Definition: validators.h:61
miner m_miner
miner instance
Definition: cryptonote_core.h:953
tools::download_async_handle m_update_download
Definition: cryptonote_core.h:999
POD_CLASS hash
Definition: hash.h:46
i_cryptonote_protocol * m_pprotocol
cryptonote protocol instance
Definition: cryptonote_core.h:948
A container for blockchain checkpoints.
Definition: checkpoints.h:52
std::string sign_message(const std::string &message, const std::string &privateKey)
Definition: crypto.h:275
bool m_fakechain
are we using a fake chain (for testing purposes)?
Definition: cryptonote_core.h:972
const std::pair< uint8_t, uint64_t > * hard_forks
Definition: cryptonote_core.h:60
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:962
Definition: cryptonote_basic.h:198
Definition: cryptonote_protocol_handler_common.h:42
Definition: core_rpc_server_commands_defs.h:443
Definition: blockchain.h:80
json::wvalue context
Definition: mustache.h:12