|
Electroneum
|
handles core cryptonote functionality More...
#include <cryptonote_core.h>


Public Member Functions | |
| core (i_cryptonote_protocol *pprotocol) | |
| constructor More... | |
| bool | handle_get_objects (NOTIFY_REQUEST_GET_OBJECTS::request &arg, NOTIFY_RESPONSE_GET_OBJECTS::request &rsp, cryptonote_connection_context &context) |
| retrieves a set of blocks and their transactions, and possibly other transactions More... | |
| bool | on_idle () |
| calls various idle routines More... | |
| bool | handle_incoming_tx (const blobdata &tx_blob, tx_verification_context &tvc, bool keeped_by_block, bool relayed, bool do_not_relay) |
| handles an incoming transaction More... | |
| 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) |
| handles a list of incoming transactions More... | |
| bool | handle_incoming_block (const blobdata &block_blob, const block *b, block_verification_context &bvc, bool update_miner_blocktemplate=true) |
| handles an incoming block More... | |
| bool | prepare_handle_incoming_blocks (const std::vector< block_complete_entry > &blocks_entry, std::vector< block > &blocks) |
| performs some preprocessing on a group of incoming blocks to speed up verification More... | |
| bool | cleanup_handle_incoming_blocks (bool force_sync=false) |
| incoming blocks post-processing, cleanup, and disk sync More... | |
| bool | check_incoming_block_size (const blobdata &block_blob) const |
| check the size of a block against the current maximum More... | |
| i_cryptonote_protocol * | get_protocol () |
| get the cryptonote protocol instance More... | |
| virtual bool | handle_block_found (block &b, block_verification_context &bvc) |
| stores and relays a block found by a miner More... | |
| virtual bool | get_block_template (block &b, const account_public_address &adr, difficulty_type &diffic, uint64_t &height, uint64_t &expected_reward, const blobdata &ex_nonce) |
| creates a new block to mine against More... | |
| virtual bool | get_block_template (block &b, const crypto::hash *prev_block, const account_public_address &adr, difficulty_type &diffic, uint64_t &height, uint64_t &expected_reward, const blobdata &ex_nonce) |
| virtual void | on_transaction_relayed (const cryptonote::blobdata &tx) |
| called when a transaction is relayed More... | |
| miner & | get_miner () |
| gets the miner instance More... | |
| const miner & | get_miner () const |
| gets the miner instance (const) More... | |
| bool | init (const boost::program_options::variables_map &vm, const test_options *test_options=NULL, const GetCheckpointsCallback &get_checkpoints=nullptr) |
| initializes the core as needed More... | |
| bool | set_genesis_block (const block &b) |
| clears the blockchain and starts a new one More... | |
| bool | deinit () |
| performs safe shutdown steps for core and core components More... | |
| void | test_drop_download () |
| sets to drop blocks downloaded (for testing) More... | |
| void | test_drop_download_height (uint64_t height) |
| sets to drop blocks downloaded below a certain height More... | |
| bool | get_test_drop_download () const |
| gets whether or not to drop blocks (for testing) More... | |
| bool | get_test_drop_download_height () const |
| gets whether or not to drop blocks More... | |
| uint64_t | get_current_blockchain_height () const |
| get the current height of the blockchain More... | |
| void | get_blockchain_top (uint64_t &height, crypto::hash &top_id) const |
| get the hash and height of the most recent block More... | |
| bool | get_blocks (uint64_t start_offset, size_t count, std::vector< std::pair< cryptonote::blobdata, block >> &blocks, std::vector< cryptonote::blobdata > &txs) const |
| bool | get_blocks (uint64_t start_offset, size_t count, std::vector< std::pair< cryptonote::blobdata, block >> &blocks) const |
| get blocks from blocks based on start height and count More... | |
| bool | get_blocks (uint64_t start_offset, size_t count, std::vector< block > &blocks) const |
| get blocks from blocks based on start height and count More... | |
| template<class t_ids_container , class t_blocks_container , class t_missed_container > | |
| 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 More... | |
| crypto::hash | get_block_id_by_height (uint64_t height) const |
| gets a block's hash given a height More... | |
| bool | get_transactions (const std::vector< crypto::hash > &txs_ids, std::vector< cryptonote::blobdata > &txs, std::vector< crypto::hash > &missed_txs) const |
| 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 |
| bool | get_transactions (const std::vector< crypto::hash > &txs_ids, std::vector< transaction > &txs, std::vector< crypto::hash > &missed_txs) const |
| bool | get_block_by_hash (const crypto::hash &h, block &blk, bool *orphan=NULL) const |
| gets the block with a given hash More... | |
| bool | get_alternative_blocks (std::vector< block > &blocks) const |
| compiles a list of all blocks stored as alternative chains More... | |
| size_t | get_alternative_blocks_count () const |
| returns the number of alternative blocks stored More... | |
| void | set_cryptonote_protocol (i_cryptonote_protocol *pprotocol) |
| set the pointer to the cryptonote protocol object to use More... | |
| void | set_checkpoints (checkpoints &&chk_pts) |
| assign a set of blockchain checkpoint hashes More... | |
| void | set_checkpoints_file_path (const std::string &path) |
| set the file path to read from when loading checkpoints More... | |
| void | set_enforce_dns_checkpoints (bool enforce_dns) |
| set whether or not we enforce DNS checkpoints More... | |
| void | disable_dns_checkpoints (bool disable=true) |
| set whether or not to enable or disable DNS checkpoints More... | |
| bool | pool_has_utxo_as_spent (const txin_to_key_public &in) const |
| get a summary statistics of all transaction hashes in the pool More... | |
| bool | pool_has_tx (const crypto::hash &txid) const |
| checks if the pool has a transaction with the given hash More... | |
| bool | get_pool_transactions (std::vector< transaction > &txs, bool include_unrelayed_txes=true) const |
| get a list of all transactions in the pool More... | |
| bool | get_txpool_backlog (std::vector< tx_backlog_entry > &backlog) const |
| bool | get_pool_transaction_hashes (std::vector< crypto::hash > &txs, bool include_unrelayed_txes=true) const |
| get a list of all transactions in the pool More... | |
| bool | get_pool_transaction_stats (struct txpool_stats &stats, bool include_unrelayed_txes=true) const |
| get a list of all transactions in the pool More... | |
| bool | get_pool_transaction (const crypto::hash &id, cryptonote::blobdata &tx) const |
| get a specific transaction from the pool More... | |
| 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 |
| bool | get_pool_for_rpc (std::vector< cryptonote::rpc::tx_in_pool > &tx_infos, cryptonote::rpc::key_images_with_tx_hashes &key_image_infos) const |
| get information about all transactions and key images in the pool More... | |
| size_t | get_pool_transactions_count () const |
| get the total number of transactions in the pool More... | |
| size_t | get_blockchain_total_transactions () const |
| gets the total number of transactions on the main chain More... | |
| bool | have_block (const crypto::hash &id) const |
| checks if a block is known about with a given hash More... | |
| bool | get_short_chain_history (std::list< crypto::hash > &ids) const |
| gets the hashes for a subset of the blockchain More... | |
| bool | find_blockchain_supplement (const std::list< crypto::hash > &qblock_ids, NOTIFY_RESPONSE_CHAIN_ENTRY::request &resp) const |
| get recent block hashes for a foreign chain More... | |
| 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 |
| bool | get_stat_info (core_stat_info &st_inf) const |
| gets some stats about the daemon More... | |
| bool | get_tx_outputs_gindexs (const crypto::hash &tx_id, std::vector< uint64_t > &indexs) const |
| gets the global indices for outputs from a given transaction More... | |
| bool | get_tx_outputs_gindexs (const crypto::hash &tx_id, size_t n_txes, std::vector< std::vector< uint64_t >> &indexs) const |
| crypto::hash | get_tail_id () const |
| get the hash of the most recent block on the blockchain More... | |
| void | set_block_cumulative_difficulty (uint64_t height, difficulty_type diff) |
| difficulty_type | get_block_cumulative_difficulty (uint64_t height) const |
| bool | get_outs (const COMMAND_RPC_GET_OUTPUTS_BIN::request &req, COMMAND_RPC_GET_OUTPUTS_BIN::response &res) const |
| gets specific outputs to mix with More... | |
| bool | get_output_distribution (uint64_t amount, uint64_t from_height, uint64_t to_height, uint64_t &start_height, std::vector< uint64_t > &distribution, uint64_t &base) const |
| gets per block distribution of outputs of a given amount More... | |
| void | pause_mine () |
| void | resume_mine () |
| Blockchain & | get_blockchain_storage () |
| gets the Blockchain instance More... | |
| const Blockchain & | get_blockchain_storage () const |
| gets the Blockchain instance (const) More... | |
| std::string | print_pool (bool short_format) const |
| get a string containing human-readable pool information More... | |
| void | on_synchronized () |
| void | safesyncmode (const bool onoff) |
| Put DB in safe sync mode. More... | |
| void | set_target_blockchain_height (uint64_t target_blockchain_height) |
| sets the target blockchain height More... | |
| uint64_t | get_target_blockchain_height () const |
| gets the target blockchain height More... | |
| uint8_t | get_ideal_hard_fork_version () const |
| returns the newest hardfork version known to the blockchain More... | |
| uint8_t | get_ideal_hard_fork_version (uint64_t height) const |
| return the ideal hard fork version for a given block height More... | |
| uint8_t | get_hard_fork_version (uint64_t height) const |
| return the hard fork version for a given block height More... | |
| uint64_t | get_earliest_ideal_height_for_version (uint8_t version) const |
| return the earliest block a given version may activate More... | |
| std::time_t | get_start_time () const |
| gets start_time More... | |
| bool | update_checkpoints () |
| tells the Blockchain to update its checkpoints More... | |
| std::string | get_validators_list () |
| Get a serialized representation of the list of validators. More... | |
| electroneum::basic::list_update_outcome | set_validators_list (std::string v_list, bool isEmergencyUpdate) |
| set the list of validators according to the serialized string passed in as parameter More... | |
| bool | isValidatorsListValid () |
| get Validators List state More... | |
| void | graceful_exit () |
| tells the daemon to wind down operations and stop running More... | |
| void | stop () |
| stops the daemon running More... | |
| bool | is_key_image_spent (const crypto::key_image &key_im) const |
| check if a key image is already spent on the blockchain More... | |
| bool | are_key_images_spent (const std::vector< crypto::key_image > &key_im, std::vector< bool > &spent) const |
| check if multiple key images are spent More... | |
| bool | utxo_nonexistant (const std::vector< txin_to_key_public > &public_outputs, std::vector< bool > &spent) const |
| check if multiple public outputs are found in the utxo database or not More... | |
| bool | are_key_images_spent_in_pool (const std::vector< crypto::key_image > &key_im, std::vector< bool > &spent) const |
| check if multiple key images are spent in the transaction pool More... | |
| size_t | get_block_sync_size (uint64_t height) const |
| get the number of blocks to sync in one go More... | |
| std::pair< uint64_t, uint64_t > | get_coinbase_tx_sum (const uint64_t start_offset, const size_t count) |
| get the sum of coinbase tx amounts between blocks More... | |
| network_type | get_nettype () const |
| get the network type we're on More... | |
| bool | is_update_available () const |
| check whether an update is known to be available or not More... | |
| bool | fluffy_blocks_enabled () const |
| get whether fluffy blocks are enabled More... | |
| bool | pad_transactions () const |
| get whether transaction relay should be padded More... | |
| uint64_t | get_free_space () const |
| get free disk space on the blockchain partition More... | |
| bool | offline () const |
| get whether the core is running offline More... | |
| uint32_t | get_blockchain_pruning_seed () const |
| get the blockchain pruning seed More... | |
| bool | prune_blockchain (uint32_t pruning_seed=0) |
| prune the blockchain More... | |
| bool | update_blockchain_pruning () |
| incrementally prunes blockchain More... | |
| bool | check_blockchain_pruning () |
| checks the blockchain pruning if enabled More... | |
| bool | set_validator_key (std::string key) |
| set validator key More... | |
| std::vector< std::string > | generate_ed25519_keypair () |
| std::string | sign_message (std::string sk, std::string msg) |
| uint64_t | get_balance (const address_parse_info &addr) |
| 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) |
| 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) |
Static Public Member Functions | |
| static void | init_options (boost::program_options::options_description &desc) |
| adds command line options to the given options set More... | |
Additional Inherited Members | |
Protected Member Functions inherited from cryptonote::i_miner_handler | |
| ~i_miner_handler () | |
handles core cryptonote functionality
This class coordinates cryptonote functionality including, but not limited to, communication among the Blockchain, the transaction pool, any miners, and the network.
Definition at line 85 of file cryptonote_core.h.
| cryptonote::core::core | ( | i_cryptonote_protocol * | pprotocol | ) |
constructor
sets member variables into a usable state
| pprotocol | pre-constructed protocol object to store and use |
Definition at line 248 of file cryptonote_core.cpp.

| bool cryptonote::core::are_key_images_spent | ( | const std::vector< crypto::key_image > & | key_im, |
| std::vector< bool > & | spent | ||
| ) | const |
check if multiple key images are spent
plural version of is_key_image_spent()
| key_im | list of key images to check |
| spent | return-by-reference result for each image checked |
Definition at line 1174 of file cryptonote_core.cpp.


| bool cryptonote::core::are_key_images_spent_in_pool | ( | const std::vector< crypto::key_image > & | key_im, |
| std::vector< bool > & | spent | ||
| ) | const |
check if multiple key images are spent in the transaction pool
| key_im | list of key images to check |
| spent | return-by-reference result for each image checked |
Definition at line 1204 of file cryptonote_core.cpp.


| bool cryptonote::core::check_blockchain_pruning | ( | ) |
checks the blockchain pruning if enabled
Definition at line 2006 of file cryptonote_core.cpp.

check the size of a block against the current maximum
| block_blob | the block to check |
Definition at line 1565 of file cryptonote_core.cpp.


incoming blocks post-processing, cleanup, and disk sync
| force_sync | if true, and Blockchain is handling syncing to disk, always sync |
Definition at line 1505 of file cryptonote_core.cpp.


| bool cryptonote::core::deinit | ( | ) |
performs safe shutdown steps for core and core components
Uninitializes the miner instance, transaction pool, and Blockchain
Definition at line 787 of file cryptonote_core.cpp.


set whether or not to enable or disable DNS checkpoints
| disble | whether to disable DNS checkpoints |
Definition at line 436 of file cryptonote_core.h.
| bool cryptonote::core::find_blockchain_supplement | ( | const std::list< crypto::hash > & | qblock_ids, |
| NOTIFY_RESPONSE_CHAIN_ENTRY::request & | resp | ||
| ) | const |
get recent block hashes for a foreign chain
Find the split point between us and foreign blockchain and return (by reference) the most recent common block hash along with up to BLOCKS_IDS_SYNCHRONIZING_DEFAULT_COUNT additional (more recent) hashes.
| qblock_ids | the foreign chain's "short history" (see get_short_chain_history) |
| resp | return-by-reference the split height and subsequent blocks' hashes |
Definition at line 1366 of file cryptonote_core.cpp.


| bool cryptonote::core::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 |
Definition at line 1371 of file cryptonote_core.cpp.

|
inline |
get whether fluffy blocks are enabled
Definition at line 824 of file cryptonote_core.h.
| std::vector< std::string > cryptonote::core::generate_ed25519_keypair | ( | ) |
Definition at line 2056 of file cryptonote_core.cpp.

| std::vector< address_txs > cryptonote::core::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 |
||
| ) |
Definition at line 2078 of file cryptonote_core.cpp.

| std::vector< address_outputs > cryptonote::core::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 |
||
| ) |
Definition at line 2072 of file cryptonote_core.cpp.

compiles a list of all blocks stored as alternative chains
| blocks | return-by-reference container to put result blocks in |
Definition at line 487 of file cryptonote_core.cpp.


| size_t cryptonote::core::get_alternative_blocks_count | ( | ) | const |
returns the number of alternative blocks stored
Definition at line 492 of file cryptonote_core.cpp.


| uint64_t cryptonote::core::get_balance | ( | const address_parse_info & | addr | ) |
Definition at line 2066 of file cryptonote_core.cpp.

| bool cryptonote::core::get_block_by_hash | ( | const crypto::hash & | h, |
| block & | blk, | ||
| bool * | orphan = NULL |
||
| ) | const |
gets the block with a given hash
| h | the hash to look for |
| blk | return-by-reference variable to put result block in |
| orphan | if non-NULL, will be set to true if not in the main chain, false otherwise |
Definition at line 1672 of file cryptonote_core.cpp.

| difficulty_type cryptonote::core::get_block_cumulative_difficulty | ( | uint64_t | height | ) | const |
Definition at line 1589 of file cryptonote_core.cpp.

| crypto::hash cryptonote::core::get_block_id_by_height | ( | uint64_t | height | ) | const |
gets a block's hash given a height
| height | the height of the block |
Definition at line 1667 of file cryptonote_core.cpp.


| size_t cryptonote::core::get_block_sync_size | ( | uint64_t | height | ) | const |
get the number of blocks to sync in one go
Definition at line 1194 of file cryptonote_core.cpp.
|
virtual |
creates a new block to mine against
| b | return-by-reference block to be filled in |
| from_block | optional block hash to start mining from (main chain tip if NULL) |
| miner_address | address new coins for the block will go to |
| di | return-by-reference tells the miner what the difficulty target is |
| height | return-by-reference tells the miner what height it's mining against |
| expected_reward | return-by-reference the total reward awarded to the miner finding this block, including transaction fees |
| ex_nonce | extra data to be added to the miner transaction's extra |
Implements cryptonote::i_miner_handler.
Definition at line 1356 of file cryptonote_core.cpp.

|
virtual |
Definition at line 1361 of file cryptonote_core.cpp.

| uint32_t cryptonote::core::get_blockchain_pruning_seed | ( | ) | const |
get the blockchain pruning seed
Definition at line 2028 of file cryptonote_core.cpp.

|
inline |
gets the Blockchain instance
Definition at line 620 of file cryptonote_core.h.

|
inline |
gets the Blockchain instance (const)
Definition at line 627 of file cryptonote_core.h.
| void cryptonote::core::get_blockchain_top | ( | uint64_t & | height, |
| crypto::hash & | top_id | ||
| ) | const |
get the hash and height of the most recent block
| height | return-by-reference height of the block |
| top_id | return-by-reference hash of the block |
Definition at line 441 of file cryptonote_core.cpp.


| size_t cryptonote::core::get_blockchain_total_transactions | ( | ) | const |
gets the total number of transactions on the main chain
Definition at line 1299 of file cryptonote_core.cpp.


| bool cryptonote::core::get_blocks | ( | uint64_t | start_offset, |
| size_t | count, | ||
| std::vector< std::pair< cryptonote::blobdata, block >> & | blocks, | ||
| std::vector< cryptonote::blobdata > & | txs | ||
| ) | const |
Definition at line 446 of file cryptonote_core.cpp.


| bool cryptonote::core::get_blocks | ( | uint64_t | start_offset, |
| size_t | count, | ||
| std::vector< std::pair< cryptonote::blobdata, block >> & | blocks | ||
| ) | const |
get blocks from blocks based on start height and count
| start_offset | the height on the blockchain to start at |
| count | the number of blocks to get, if there are as many after start_offset |
| blocks | return-by-reference container to put result blocks in |
Definition at line 451 of file cryptonote_core.cpp.

| bool cryptonote::core::get_blocks | ( | uint64_t | start_offset, |
| size_t | count, | ||
| std::vector< block > & | blocks | ||
| ) | const |
get blocks from blocks based on start height and count
| start_offset | the height on the blockchain to start at |
| count | the number of blocks to get, if there are as many after start_offset |
| blocks | return-by-reference container to put result blocks in |
Definition at line 456 of file cryptonote_core.cpp.

|
inline |
gets blocks based on a list of block hashes
| t_ids_container | a standard-iterable container |
| t_blocks_container | a standard-iterable container |
| t_missed_container | a standard-iterable container |
| block_ids | a container of block hashes for which to get the corresponding blocks |
| blocks | return-by-reference a container to store result blocks in |
| missed_bs | return-by-reference a container to store missed blocks in |
Definition at line 349 of file cryptonote_core.h.
| std::pair< uint64_t, uint64_t > cryptonote::core::get_coinbase_tx_sum | ( | const uint64_t | start_offset, |
| const size_t | count | ||
| ) |
get the sum of coinbase tx amounts between blocks
Definition at line 1210 of file cryptonote_core.cpp.

| uint64_t cryptonote::core::get_current_blockchain_height | ( | ) | const |
get the current height of the blockchain
Definition at line 436 of file cryptonote_core.cpp.


return the earliest block a given version may activate
Definition at line 1765 of file cryptonote_core.cpp.

| uint64_t cryptonote::core::get_free_space | ( | ) | const |
get free disk space on the blockchain partition
Definition at line 2021 of file cryptonote_core.cpp.

return the hard fork version for a given block height
Definition at line 1760 of file cryptonote_core.cpp.

| uint8_t cryptonote::core::get_ideal_hard_fork_version | ( | ) | const |
returns the newest hardfork version known to the blockchain
Definition at line 1750 of file cryptonote_core.cpp.

return the ideal hard fork version for a given block height
Definition at line 1755 of file cryptonote_core.cpp.

|
inline |
gets the miner instance
Definition at line 229 of file cryptonote_core.h.

|
inline |
gets the miner instance (const)
Definition at line 236 of file cryptonote_core.h.
|
inline |
get the network type we're on
Definition at line 807 of file cryptonote_core.h.

| bool cryptonote::core::get_output_distribution | ( | uint64_t | amount, |
| uint64_t | from_height, | ||
| uint64_t | to_height, | ||
| uint64_t & | start_height, | ||
| std::vector< uint64_t > & | distribution, | ||
| uint64_t & | base | ||
| ) | const |
gets per block distribution of outputs of a given amount
| amount | the amount to get a ditribution for |
| from_height | the height before which we do not care about the data |
| to_height | the height after which we do not care about the data |
| return-by-reference | start_height the height of the first rct output |
| return-by-reference | distribution the start offset of the first rct output in this block (same as previous if none) |
| return-by-reference | base how many outputs of that amount are before the stated distribution |
get per block distribution of outputs of a given amount
Definition at line 1381 of file cryptonote_core.cpp.


| bool cryptonote::core::get_outs | ( | const COMMAND_RPC_GET_OUTPUTS_BIN::request & | req, |
| COMMAND_RPC_GET_OUTPUTS_BIN::response & | res | ||
| ) | const |
gets specific outputs to mix with
This function takes an RPC request for outputs to mix with and creates an RPC response with the resultant output indices.
Outputs to mix with are specified in the request.
| req | the outputs to return |
| res | return-by-reference the resultant output indices and keys |
Definition at line 1376 of file cryptonote_core.cpp.

| bool cryptonote::core::get_pool_for_rpc | ( | std::vector< cryptonote::rpc::tx_in_pool > & | tx_infos, |
| cryptonote::rpc::key_images_with_tx_hashes & | key_image_infos | ||
| ) | const |
get information about all transactions and key images in the pool
see documentation on tx_in_pool and key_images_with_tx_hashes for more details
| tx_infos | [out] the transactions' information |
| key_image_infos | [out] the spent key images' information |
Definition at line 1652 of file cryptonote_core.cpp.


| bool cryptonote::core::get_pool_transaction | ( | const crypto::hash & | id, |
| cryptonote::blobdata & | tx | ||
| ) | const |
get a specific transaction from the pool
| h | the hash of the transaction to get |
| tx | return-by-reference the transaction blob requested |
Definition at line 1632 of file cryptonote_core.cpp.

| bool cryptonote::core::get_pool_transaction_hashes | ( | std::vector< crypto::hash > & | txs, |
| bool | include_unrelayed_txes = true |
||
| ) | const |
get a list of all transactions in the pool
| txs | return-by-reference the list of transactions |
| include_unrelayed_txes | include unrelayed txes in the result |
| include_unrelayed_txes | include unrelayed txes in result |
Definition at line 1620 of file cryptonote_core.cpp.


| bool cryptonote::core::get_pool_transaction_stats | ( | struct txpool_stats & | stats, |
| bool | include_unrelayed_txes = true |
||
| ) | const |
get a list of all transactions in the pool
| txs | return-by-reference the list of transactions |
| include_unrelayed_txes | include unrelayed txes in the result |
| include_unrelayed_txes | include unrelayed txes in result |
Definition at line 1626 of file cryptonote_core.cpp.

| bool cryptonote::core::get_pool_transactions | ( | std::vector< transaction > & | txs, |
| bool | include_unrelayed_txes = true |
||
| ) | const |
get a list of all transactions in the pool
| txs | return-by-reference the list of transactions |
| include_unrelayed_txes | include unrelayed txes in the result |
| include_unrelayed_txes | include unrelayed txes in result |
Definition at line 1614 of file cryptonote_core.cpp.


| bool cryptonote::core::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 |
| include_unrelayed_txes | include unrelayed txes in result |
Definition at line 1647 of file cryptonote_core.cpp.

| size_t cryptonote::core::get_pool_transactions_count | ( | ) | const |
get the total number of transactions in the pool
Definition at line 1594 of file cryptonote_core.cpp.


|
inline |
get the cryptonote protocol instance
Definition at line 192 of file cryptonote_core.h.
| bool cryptonote::core::get_short_chain_history | ( | std::list< crypto::hash > & | ids | ) | const |
gets the hashes for a subset of the blockchain
puts into list <ids> a list of hashes representing certain blocks from the blockchain in reverse chronological order
the blocks chosen, at the time of this writing, are: the most recent 11 powers of 2 less recent from there, so 13, 17, 25, etc...
| ids | return-by-reference list to put the resulting hashes in |
Definition at line 1657 of file cryptonote_core.cpp.

| bool cryptonote::core::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 |
Definition at line 471 of file cryptonote_core.cpp.

| std::time_t cryptonote::core::get_start_time | ( | ) | const |
gets start_time
Definition at line 2038 of file cryptonote_core.cpp.

| bool cryptonote::core::get_stat_info | ( | core_stat_info & | st_inf | ) | const |
gets some stats about the daemon
| st_inf | return-by-reference container for the stats requested |
Definition at line 1052 of file cryptonote_core.cpp.

| crypto::hash cryptonote::core::get_tail_id | ( | ) | const |
get the hash of the most recent block on the blockchain
Definition at line 1579 of file cryptonote_core.cpp.


| uint64_t cryptonote::core::get_target_blockchain_height | ( | ) | const |
gets the target blockchain height
| target_blockchain_height | the target height |
Definition at line 2016 of file cryptonote_core.cpp.

| bool cryptonote::core::get_test_drop_download | ( | ) | const |
gets whether or not to drop blocks (for testing)
Definition at line 805 of file cryptonote_core.cpp.
| bool cryptonote::core::get_test_drop_download_height | ( | ) | const |
gets whether or not to drop blocks
If the current blockchain height <= our block drop threshold and test drop blocks is set, return true
Definition at line 810 of file cryptonote_core.cpp.

| bool cryptonote::core::get_transactions | ( | const std::vector< crypto::hash > & | txs_ids, |
| std::vector< cryptonote::blobdata > & | txs, | ||
| std::vector< crypto::hash > & | missed_txs | ||
| ) | const |
Definition at line 466 of file cryptonote_core.cpp.


| bool cryptonote::core::get_transactions | ( | const std::vector< crypto::hash > & | txs_ids, |
| std::vector< transaction > & | txs, | ||
| std::vector< crypto::hash > & | missed_txs | ||
| ) | const |
Definition at line 482 of file cryptonote_core.cpp.

| bool cryptonote::core::get_tx_outputs_gindexs | ( | const crypto::hash & | tx_id, |
| std::vector< uint64_t > & | indexs | ||
| ) | const |
gets the global indices for outputs from a given transaction
This function gets the global indices for all outputs belonging to a specific transaction.
| tx_id | the hash of the transaction to fetch indices for |
| indexs | return-by-reference the global indices for the transaction's outputs |
| n_txes | how many txes in a row to get results for |
Definition at line 1386 of file cryptonote_core.cpp.


| bool cryptonote::core::get_tx_outputs_gindexs | ( | const crypto::hash & | tx_id, |
| size_t | n_txes, | ||
| std::vector< std::vector< uint64_t >> & | indexs | ||
| ) | const |
Definition at line 1391 of file cryptonote_core.cpp.

| bool cryptonote::core::get_txpool_backlog | ( | std::vector< tx_backlog_entry > & | backlog | ) | const |
Definition at line 476 of file cryptonote_core.cpp.

| std::string cryptonote::core::get_validators_list | ( | ) |
Get a serialized representation of the list of validators.
Definition at line 319 of file cryptonote_core.cpp.
| void cryptonote::core::graceful_exit | ( | ) |
tells the daemon to wind down operations and stop running
Currently this function raises SIGTERM, allowing the installed signal handlers to do the actual stopping.
Definition at line 2084 of file cryptonote_core.cpp.

|
virtual |
stores and relays a block found by a miner
Updates the miner's target block, attempts to store the found block in Blockchain, and – on success – relays that block to the network.
| b | the block found |
| bvc | returns the block verification flags |
Implements cryptonote::i_miner_handler.
Definition at line 1419 of file cryptonote_core.cpp.

| bool cryptonote::core::handle_get_objects | ( | NOTIFY_REQUEST_GET_OBJECTS::request & | arg, |
| NOTIFY_RESPONSE_GET_OBJECTS::request & | rsp, | ||
| cryptonote_connection_context & | context | ||
| ) |
retrieves a set of blocks and their transactions, and possibly other transactions
the request object encapsulates a list of block hashes and a (possibly empty) list of transaction hashes. for each block hash, the block is fetched along with all of that block's transactions. Any transactions requested separately are fetched afterwards.
| arg | the request |
| rsp | return-by-reference the response to fill in |
| context | connection context associated with the request |
Definition at line 1662 of file cryptonote_core.cpp.

| bool cryptonote::core::handle_incoming_block | ( | const blobdata & | block_blob, |
| const block * | b, | ||
| block_verification_context & | bvc, | ||
| bool | update_miner_blocktemplate = true |
||
| ) |
handles an incoming block
periodic update to checkpoints is triggered here Attempts to add the block to the Blockchain and, on success, optionally updates the miner's block template.
| block_blob | the block to be added |
| block | the block to be added, or NULL |
| bvc | return-by-reference metadata context about the block's validity |
| update_miner_blocktemplate | whether or not to update the miner's block template |
Definition at line 1517 of file cryptonote_core.cpp.


| bool cryptonote::core::handle_incoming_tx | ( | const blobdata & | tx_blob, |
| tx_verification_context & | tvc, | ||
| bool | keeped_by_block, | ||
| bool | relayed, | ||
| bool | do_not_relay | ||
| ) |
handles an incoming transaction
Parses an incoming transaction and, if nothing is obviously wrong, passes it along to the transaction pool
| tx_blob | the tx to handle |
| tvc | metadata about the transaction's validity |
| keeped_by_block | if the transaction has been in a block |
| relayed | whether or not the transaction was relayed to us |
| do_not_relay | whether to prevent the transaction from being relayed |
Definition at line 1042 of file cryptonote_core.cpp.


| bool cryptonote::core::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 | ||
| ) |
handles a list of incoming transactions
Parses incoming transactions and, if nothing is obviously wrong, passes them along to the transaction pool
| tx_blobs | the txs to handle |
| tvc | metadata about the transactions' validity |
| keeped_by_block | if the transactions have been in a block |
| relayed | whether or not the transactions were relayed to us |
| do_not_relay | whether to prevent the transactions from being relayed |
Definition at line 944 of file cryptonote_core.cpp.


| bool cryptonote::core::have_block | ( | const crypto::hash & | id | ) | const |
checks if a block is known about with a given hash
This function checks the main chain, alternate chains, and invalid blocks for a block with the given hash
| id | the hash to search for |
Definition at line 1599 of file cryptonote_core.cpp.

| bool cryptonote::core::init | ( | const boost::program_options::variables_map & | vm, |
| const test_options * | test_options = NULL, |
||
| const GetCheckpointsCallback & | get_checkpoints = nullptr |
||
| ) |
initializes the core as needed
This function initializes the transaction pool, the Blockchain, and a miner instance with parameters given on the command line (or defaults)
| vm | command line parameters |
| test_options | configuration options for testing |
| get_checkpoints | if set, will be called to get checkpoints data, must return checkpoints data pointer and size or nullptr if there ain't any checkpoints for specific network type |
Definition at line 497 of file cryptonote_core.cpp.


|
static |
adds command line options to the given options set
As of now, there are no command line options specific to core, so this function simply returns.
| desc | return-by-reference the command line options set to add to |
Definition at line 346 of file cryptonote_core.cpp.


| bool cryptonote::core::is_key_image_spent | ( | const crypto::key_image & | key_im | ) | const |
check if a key image is already spent on the blockchain
Whenever a transaction output is used as an input for another transaction (a true input, not just one of a mixing set), a key image is generated and stored in the transaction in order to prevent double spending. If this key image is seen again, the transaction using it is rejected.
| key_im | the key image to search for |
Definition at line 1169 of file cryptonote_core.cpp.

|
inline |
check whether an update is known to be available or not
This does not actually trigger a check, but returns the result of the last check
Definition at line 817 of file cryptonote_core.h.

| bool cryptonote::core::isValidatorsListValid | ( | ) |
get Validators List state
Definition at line 327 of file cryptonote_core.cpp.
|
inline |
get whether the core is running offline
Definition at line 845 of file cryptonote_core.h.

| bool cryptonote::core::on_idle | ( | ) |
calls various idle routines
Definition at line 1688 of file cryptonote_core.cpp.

| void cryptonote::core::on_synchronized | ( | ) |
Definition at line 1477 of file cryptonote_core.cpp.

|
virtual |
called when a transaction is relayed
Definition at line 1342 of file cryptonote_core.cpp.

|
inline |
get whether transaction relay should be padded
Definition at line 831 of file cryptonote_core.h.
| void cryptonote::core::pause_mine | ( | ) |
Definition at line 1396 of file cryptonote_core.cpp.

| bool cryptonote::core::pool_has_tx | ( | const crypto::hash & | txid | ) | const |
checks if the pool has a transaction with the given hash
| id | the hash to look for |
Definition at line 1637 of file cryptonote_core.cpp.

| bool cryptonote::core::pool_has_utxo_as_spent | ( | const txin_to_key_public & | in | ) | const |
get a summary statistics of all transaction hashes in the pool
| in | input to check the pool spent status of |
Definition at line 1642 of file cryptonote_core.cpp.

| bool cryptonote::core::prepare_handle_incoming_blocks | ( | const std::vector< block_complete_entry > & | blocks_entry, |
| std::vector< block > & | blocks | ||
| ) |
performs some preprocessing on a group of incoming blocks to speed up verification
| blocks_entry | a list of incoming blocks |
| blocks | the parsed blocks |
Definition at line 1493 of file cryptonote_core.cpp.


| std::string cryptonote::core::print_pool | ( | bool | short_format | ) | const |
get a string containing human-readable pool information
| short_format | whether to use a shortened format for the info |
Definition at line 1677 of file cryptonote_core.cpp.

prune the blockchain
| pruning_seed | the seed to use to prune the chain (0 for default, highly recommended) |
Definition at line 2033 of file cryptonote_core.cpp.


| void cryptonote::core::resume_mine | ( | ) |
Definition at line 1401 of file cryptonote_core.cpp.

| void cryptonote::core::safesyncmode | ( | const bool | onoff | ) |
Put DB in safe sync mode.
2note see Blockchain::safesyncmode
Definition at line 1482 of file cryptonote_core.cpp.

| void cryptonote::core::set_block_cumulative_difficulty | ( | uint64_t | height, |
| difficulty_type | diff | ||
| ) |
Definition at line 1584 of file cryptonote_core.cpp.

| void cryptonote::core::set_checkpoints | ( | checkpoints && | chk_pts | ) |
assign a set of blockchain checkpoint hashes
| chk_pts | the set of checkpoints to assign |
Definition at line 275 of file cryptonote_core.cpp.

| void cryptonote::core::set_checkpoints_file_path | ( | const std::string & | path | ) |
set the file path to read from when loading checkpoints
| path | the path to set ours as |
Definition at line 280 of file cryptonote_core.cpp.
| void cryptonote::core::set_cryptonote_protocol | ( | i_cryptonote_protocol * | pprotocol | ) |
set the pointer to the cryptonote protocol object to use
| pprotocol | the pointer to set ours as |
Definition at line 267 of file cryptonote_core.cpp.

| void cryptonote::core::set_enforce_dns_checkpoints | ( | bool | enforce_dns | ) |
set whether or not we enforce DNS checkpoints
| enforce_dns | enforce DNS checkpoints or not |
Definition at line 285 of file cryptonote_core.cpp.

clears the blockchain and starts a new one
| b | the first block in the new chain (the genesis block) |
Definition at line 776 of file cryptonote_core.cpp.


| void cryptonote::core::set_target_blockchain_height | ( | uint64_t | target_blockchain_height | ) |
sets the target blockchain height
| target_blockchain_height | the height to set |
Definition at line 2011 of file cryptonote_core.cpp.
| bool cryptonote::core::set_validator_key | ( | std::string | key | ) |
set validator key
| key | key to set as new validator key |
Definition at line 2043 of file cryptonote_core.cpp.

| electroneum::basic::list_update_outcome cryptonote::core::set_validators_list | ( | std::string | v_list, |
| bool | isEmergencyUpdate | ||
| ) |
set the list of validators according to the serialized string passed in as parameter
| v_list | serialized validators list string |
Definition at line 323 of file cryptonote_core.cpp.
| std::string cryptonote::core::sign_message | ( | std::string | sk, |
| std::string | msg | ||
| ) |
Definition at line 2061 of file cryptonote_core.cpp.

| void cryptonote::core::stop | ( | ) |
stops the daemon running
Definition at line 331 of file cryptonote_core.cpp.

| void cryptonote::core::test_drop_download | ( | ) |
sets to drop blocks downloaded (for testing)
Definition at line 795 of file cryptonote_core.cpp.
| void cryptonote::core::test_drop_download_height | ( | uint64_t | height | ) |
sets to drop blocks downloaded below a certain height
| height | height below which to drop blocks |
Definition at line 800 of file cryptonote_core.cpp.
| bool cryptonote::core::update_blockchain_pruning | ( | ) |
incrementally prunes blockchain
Definition at line 2001 of file cryptonote_core.cpp.


| bool cryptonote::core::update_checkpoints | ( | ) |
tells the Blockchain to update its checkpoints
This function will check if enough time has passed since the last time checkpoints were updated and tell the Blockchain to update its checkpoints if it is time. If updating checkpoints fails, the daemon is told to shut down.
Definition at line 290 of file cryptonote_core.cpp.


| bool cryptonote::core::utxo_nonexistant | ( | const std::vector< txin_to_key_public > & | public_outputs, |
| std::vector< bool > & | spent | ||
| ) | const |
check if multiple public outputs are found in the utxo database or not
plural version of is_public_output_spent()
| key_im | list of public outputs to check |
| spent | return-by-reference result for each public output checked |
Definition at line 1184 of file cryptonote_core.cpp.
