|
Monero
|
Various Tools. More...
Namespaces | |
| namespace | base58 |
| namespace | dns_utils |
| namespace | detail |
| namespace | error |
| namespace | wallet_rpc |
Typedefs | |
| typedef class scoped_ptr< ub_result, ub_resolve_free > | ub_result_ptr |
| typedef std::shared_ptr< download_thread_control > | download_async_handle |
Enumerations | |
| enum | { EVARINT_OVERFLOW = -1 , EVARINT_REPRESENT = -2 } |
| Error codes for varint. More... | |
Functions | |
| template<typename F> | |
| void | apply_permutation (std::vector< size_t > permutation, const F &swap) |
| template<typename T> | |
| void | apply_permutation (const std::vector< size_t > &permutation, std::vector< T > &v) |
| template<class t_object> | |
| bool | serialize_obj_to_file (t_object &obj, const std::string &file_path) |
| template<class t_object> | |
| bool | unserialize_obj_from_file (t_object &obj, const std::string &file_path) |
| uint64_t | combinations_count (uint32_t k, uint32_t n) |
| static const char * | get_record_name (int record_type) |
| boost::optional< std::string > | ipv4_to_string (const char *src, size_t len) |
| boost::optional< std::string > | ipv6_to_string (const char *src, size_t len) |
| boost::optional< std::string > | txt_to_string (const char *src, size_t len) |
| boost::optional< std::string > | tlsa_to_string (const char *src, size_t len) |
| static void | add_anchors (ub_ctx *ctx) |
| static void | download_thread (download_async_handle control) |
| bool | download (const std::string &path, const std::string &url, std::function< bool(const std::string &, const std::string &, size_t, ssize_t)> cb) |
| download_async_handle | download_async (const std::string &path, const std::string &url, std::function< void(const std::string &, const std::string &, bool)> result, std::function< bool(const std::string &, const std::string &, size_t, ssize_t)> progress) |
| bool | download_finished (const download_async_handle &control) |
| bool | download_error (const download_async_handle &control) |
| bool | download_wait (const download_async_handle &control) |
| bool | download_cancel (const download_async_handle &control) |
| static void | replace (std::vector< std::string > &v, const char *tag, const char *s) |
| uint64_t | get_tick_count () |
| uint64_t | ticks_to_ns (uint64_t ticks) |
| void | set_performance_timer_log_level (el::Level level) |
| uint64_t | get_ticks_per_ns () |
| uint32_t | make_pruning_seed (uint32_t stripe, uint32_t log_stripes) |
| bool | has_unpruned_block (uint64_t block_height, uint64_t blockchain_height, uint32_t pruning_seed) |
| uint32_t | get_pruning_stripe (uint64_t block_height, uint64_t blockchain_height, uint32_t log_stripes) |
| uint32_t | get_pruning_seed (uint64_t block_height, uint64_t blockchain_height, uint32_t log_stripes) |
| uint64_t | get_next_unpruned_block_height (uint64_t block_height, uint64_t blockchain_height, uint32_t pruning_seed) |
| uint64_t | get_next_pruned_block_height (uint64_t block_height, uint64_t blockchain_height, uint32_t pruning_seed) |
| uint32_t | get_random_stripe () |
| constexpr uint32_t | get_pruning_log_stripes (uint32_t pruning_seed) |
| uint32_t | get_pruning_stripe (uint32_t pruning_seed) |
| scoped_message_writer | success_msg_writer (bool color=true) |
| scoped_message_writer | msg_writer (epee::console_colors color=epee::console_color_default) |
| scoped_message_writer | fail_msg_writer () |
| int | spawn (const char *filename, const std::vector< std::string > &args, bool wait) |
| void | set_stack_trace_log (const std::string &log) |
| void | log_stack_trace (const char *msg) |
| bool | check_updates (const std::string &software, const std::string &buildtag, std::string &version, std::string &hash) |
| std::string | get_update_url (const std::string &software, const std::string &subdir, const std::string &buildtag, const std::string &version, bool user) |
| template<typename T, typename Transform> | |
| T | utf8canonical (const T &s, Transform t=[](wint_t c) ->wint_t { return c;}) |
| void | copy_file (const std::string &from, const std::string &to) |
| std::string | get_nix_version_display_string () |
| std::string | get_os_version_string () |
| Returns the OS version string. | |
| std::string | get_default_data_dir () |
| Returns the default data directory. | |
| bool | create_directories_if_necessary (const std::string &path) |
| creates directories for a path | |
| std::error_code | replace_file (const std::string &old_name, const std::string &new_name) |
| std::rename wrapper for nix and something strange for windows. | |
| static bool | unbound_built_with_threads () |
| bool | sanitize_locale () |
| static void | setup_crash_dump () |
| bool | disable_core_dumps () |
| ssize_t | get_lockable_memory () |
| bool | on_startup () |
| void | set_strict_default_file_permissions (bool strict) |
| boost::optional< bool > | is_hdd (const char *file_path) |
| void | set_max_concurrency (unsigned n) |
| unsigned | get_max_concurrency () |
| bool | is_privacy_preserving_network (const std::string &address) |
| bool | is_local_address (const std::string &address) |
| int | vercmp (const char *v0, const char *v1) |
| bool | sha256sum (const uint8_t *data, size_t len, crypto::hash &hash) |
| Creates a SHA-256 digest of a data buffer. | |
| bool | sha256sum (const std::string &filename, crypto::hash &hash) |
| Creates a SHA-256 digest of a file's contents, equivalent to the sha256sum command in Linux. | |
| boost::optional< std::pair< uint32_t, uint32_t > > | parse_subaddress_lookahead (const std::string &str) |
| std::string | glob_to_regex (const std::string &val) |
| void | closefrom (int fd) |
| std::string | get_human_readable_timestamp (uint64_t ts) |
| std::string | get_human_readable_timespan (uint64_t seconds) |
| std::string | get_human_readable_bytes (uint64_t bytes) |
| void | clear_screen () |
| std::pair< std::string, size_t > | get_string_prefix_by_width (const std::string &s, size_t columns) |
| size_t | get_string_width (const std::string &s) |
| std::vector< std::pair< std::string, size_t > > | split_line_by_width (const std::string &s, size_t columns) |
| uint64_t | cumulative_block_sync_weight (cryptonote::network_type nettype, uint64_t start_block, uint64_t num_blocks) |
| std::vector< std::pair< std::string, size_t > > | split_string_by_width (const std::string &s, size_t columns) |
| template<typename OutputIt, typename T> | |
| std::enable_if< std::is_integral< T >::value &&std::is_unsigned< T >::value, void >::type | write_varint (OutputIt &&dest, T i) |
| writes a varint to a stream. | |
| template<typename T> | |
| std::string | get_varint_data (const T &v) |
| Returns the string that represents the varint. | |
| template<int bits, typename InputIt, typename T> | |
| std::enable_if< std::is_integral< T >::value &&std::is_unsigned< T >::value &&0<=bits &&bits<=std::numeric_limits< T >::digits, int >::type | read_varint (InputIt &&first, InputIt &&last, T &write) |
| reads in the varint that is pointed to by InputIt into write | |
| template<typename InputIt, typename T> | |
| int | read_varint (InputIt &&first, InputIt &&last, T &i) |
| Wrapper around the other read_varint, Sets template parameters for you. | |
| void | reattach_blockchain (hashchain &blockchain, wallet2::detached_blockchain_data &dbd) |
| bool | has_nonrequested_tx_at_height_or_above_requested (uint64_t height, const std::unordered_set< crypto::hash > &requested_txids, const wallet2::transfer_container &transfers, const wallet2::payment_container &payments, const serializable_unordered_map< crypto::hash, wallet2::confirmed_transfer_details > &confirmed_txs) |
| static uint64_t | decodeRct (const rct::rctSig &rv, const crypto::key_derivation &derivation, unsigned int i, rct::key &mask, hw::device &hwdev) |
| void | read_pool_txs (const cryptonote::COMMAND_RPC_GET_TRANSACTIONS::request &req, const cryptonote::COMMAND_RPC_GET_TRANSACTIONS::response &res, bool r, const std::vector< crypto::hash > &txids, std::vector< std::tuple< cryptonote::transaction, crypto::hash, bool > > &txs) |
| void | check_block_hard_fork_version (cryptonote::network_type nettype, uint8_t hf_version, uint64_t height, bool &wallet_is_outdated, bool &daemon_is_outdated) |
| void | validate_background_cache_password_usage (const tools::wallet2::BackgroundSyncType background_sync_type, const boost::optional< epee::wipeable_string > &background_cache_password, const bool multisig, const bool watch_only, const bool key_on_device) |
| void | get_custom_background_key (const epee::wipeable_string &password, crypto::chacha_key &custom_background_key, const uint64_t kdf_rounds) |
| std::pair< std::set< uint64_t >, size_t > | outs_unique (const std::vector< std::vector< tools::wallet2::get_outs_entry > > &outs) |
| static uint32_t | get_count_above (const std::vector< wallet2::transfer_details > &transfers, const std::vector< size_t > &indices, uint64_t threshold) |
| static crypto::hash | get_message_hash (const std::string &data, const crypto::public_key &spend_key, const crypto::public_key &view_key, const uint8_t mode) |
| static void | check_rpc_cost (rpc_payment_state_t &rpc_payment_state, const char *call, uint64_t post_call_credits, uint64_t pre_call_credits, double expected_cost) |
| static std::string | ptx_to_string (const tools::wallet2::pending_tx &ptx) |
| template<typename T> | |
| static bool | is_error_value (const T &val) |
| static bool | is_error_value (const std::string &s) |
| template<typename T, typename V> | |
| static bool | fill (T &where, V s) |
| template<typename T, typename V> | |
| static bool | fill (std::list< T > &where, V s) |
| static uint64_t | total_amount (const tools::wallet2::pending_tx &ptx) |
Variables | |
| constexpr const int | DNS_CLASS_IN = 1 |
| constexpr const int | DNS_TYPE_A = 1 |
| constexpr const int | DNS_TYPE_TXT = 16 |
| constexpr const int | DNS_TYPE_AAAA = 8 |
| constexpr const int | DNS_TYPE_TLSA = 52 |
| el::Level | performance_timer_log_level = el::Level::Info |
| static __thread std::vector< LoggingPerformanceTimer * > * | performance_timers = NULL |
| static constexpr uint32_t | PRUNING_SEED_LOG_STRIPES_SHIFT = 7 |
| static constexpr uint32_t | PRUNING_SEED_LOG_STRIPES_MASK = 0x7 |
| static constexpr uint32_t | PRUNING_SEED_STRIPE_SHIFT = 0 |
| static constexpr uint32_t | PRUNING_SEED_STRIPE_MASK = 0x7f |
| static const std::chrono::seconds | rpc_timeout = std::chrono::minutes(3) + std::chrono::seconds(30) |
Various Tools.
| typedef std::shared_ptr<download_thread_control> tools::download_async_handle |
| typedef class scoped_ptr< ub_result, ub_resolve_free > tools::ub_result_ptr |
|
static |
| void tools::apply_permutation | ( | const std::vector< size_t > & | permutation, |
| std::vector< T > & | v ) |
| void tools::apply_permutation | ( | std::vector< size_t > | permutation, |
| const F & | swap ) |
| void tools::check_block_hard_fork_version | ( | cryptonote::network_type | nettype, |
| uint8_t | hf_version, | ||
| uint64_t | height, | ||
| bool & | wallet_is_outdated, | ||
| bool & | daemon_is_outdated ) |
|
inlinestatic |
| bool tools::check_updates | ( | const std::string & | software, |
| const std::string & | buildtag, | ||
| std::string & | version, | ||
| std::string & | hash ) |
| void tools::clear_screen | ( | ) |
| void tools::closefrom | ( | int | fd | ) |
| bool tools::create_directories_if_necessary | ( | const std::string & | path | ) |
creates directories for a path
wrapper around boost::filesyste::create_directories.
(ensure-directory-exists): greenspun's tenth rule in action!
| uint64_t tools::cumulative_block_sync_weight | ( | cryptonote::network_type | nettype, |
| uint64_t | start_block, | ||
| uint64_t | num_blocks ) |
|
static |
| bool tools::disable_core_dumps | ( | ) |
| bool tools::download | ( | const std::string & | path, |
| const std::string & | url, | ||
| std::function< bool(const std::string &, const std::string &, size_t, ssize_t)> | cb ) |
| download_async_handle tools::download_async | ( | const std::string & | path, |
| const std::string & | url, | ||
| std::function< void(const std::string &, const std::string &, bool)> | result, | ||
| std::function< bool(const std::string &, const std::string &, size_t, ssize_t)> | progress ) |
| bool tools::download_cancel | ( | const download_async_handle & | control | ) |
| bool tools::download_error | ( | const download_async_handle & | control | ) |
| bool tools::download_finished | ( | const download_async_handle & | control | ) |
|
static |
| bool tools::download_wait | ( | const download_async_handle & | control | ) |
|
inline |
|
static |
| void tools::get_custom_background_key | ( | const epee::wipeable_string & | password, |
| crypto::chacha_key & | custom_background_key, | ||
| const uint64_t | kdf_rounds ) |
| std::string tools::get_default_data_dir | ( | ) |
Returns the default data directory.
Windows < Vista: C:\Documents and Settings\Username\Application Data\CRYPTONOTE_NAME
Windows >= Vista: C:\Users\Username\AppData\Roaming\CRYPTONOTE_NAME
Mac: ~/Library/Application Support/CRYPTONOTE_NAME
Unix: ~/.CRYPTONOTE_NAME
| std::string tools::get_human_readable_bytes | ( | uint64_t | bytes | ) |
| std::string tools::get_human_readable_timespan | ( | uint64_t | seconds | ) |
| std::string tools::get_human_readable_timestamp | ( | uint64_t | ts | ) |
| ssize_t tools::get_lockable_memory | ( | ) |
| unsigned tools::get_max_concurrency | ( | ) |
|
static |
| uint64_t tools::get_next_pruned_block_height | ( | uint64_t | block_height, |
| uint64_t | blockchain_height, | ||
| uint32_t | pruning_seed ) |
| uint64_t tools::get_next_unpruned_block_height | ( | uint64_t | block_height, |
| uint64_t | blockchain_height, | ||
| uint32_t | pruning_seed ) |
| std::string tools::get_nix_version_display_string | ( | ) |
| std::string tools::get_os_version_string | ( | ) |
Returns the OS version string.
This is a wrapper around the primitives get_windows_version_display_string() and get_nix_version_display_string()
| uint32_t tools::get_pruning_seed | ( | uint64_t | block_height, |
| uint64_t | blockchain_height, | ||
| uint32_t | log_stripes ) |
| uint32_t tools::get_pruning_stripe | ( | uint64_t | block_height, |
| uint64_t | blockchain_height, | ||
| uint32_t | log_stripes ) |
| uint32_t tools::get_random_stripe | ( | ) |
|
static |
| std::pair< std::string, size_t > tools::get_string_prefix_by_width | ( | const std::string & | s, |
| size_t | columns ) |
| size_t tools::get_string_width | ( | const std::string & | s | ) |
| uint64_t tools::get_tick_count | ( | ) |
| uint64_t tools::get_ticks_per_ns | ( | ) |
| std::string tools::get_update_url | ( | const std::string & | software, |
| const std::string & | subdir, | ||
| const std::string & | buildtag, | ||
| const std::string & | version, | ||
| bool | user ) |
Returns the string that represents the varint.
| std::string tools::glob_to_regex | ( | const std::string & | val | ) |
| bool tools::has_nonrequested_tx_at_height_or_above_requested | ( | uint64_t | height, |
| const std::unordered_set< crypto::hash > & | requested_txids, | ||
| const wallet2::transfer_container & | transfers, | ||
| const wallet2::payment_container & | payments, | ||
| const serializable_unordered_map< crypto::hash, wallet2::confirmed_transfer_details > & | confirmed_txs ) |
| bool tools::has_unpruned_block | ( | uint64_t | block_height, |
| uint64_t | blockchain_height, | ||
| uint32_t | pruning_seed ) |
| boost::optional< std::string > tools::ipv4_to_string | ( | const char * | src, |
| size_t | len ) |
| boost::optional< std::string > tools::ipv6_to_string | ( | const char * | src, |
| size_t | len ) |
|
static |
| boost::optional< bool > tools::is_hdd | ( | const char * | file_path | ) |
| bool tools::is_local_address | ( | const std::string & | address | ) |
| bool tools::is_privacy_preserving_network | ( | const std::string & | address | ) |
| void tools::log_stack_trace | ( | const char * | msg | ) |
|
inline |
| bool tools::on_startup | ( | ) |
| std::pair< std::set< uint64_t >, size_t > tools::outs_unique | ( | const std::vector< std::vector< tools::wallet2::get_outs_entry > > & | outs | ) |
| boost::optional< std::pair< uint32_t, uint32_t > > tools::parse_subaddress_lookahead | ( | const std::string & | str | ) |
|
static |
| void tools::read_pool_txs | ( | const cryptonote::COMMAND_RPC_GET_TRANSACTIONS::request & | req, |
| const cryptonote::COMMAND_RPC_GET_TRANSACTIONS::response & | res, | ||
| bool | r, | ||
| const std::vector< crypto::hash > & | txids, | ||
| std::vector< std::tuple< cryptonote::transaction, crypto::hash, bool > > & | txs ) |
| int tools::read_varint | ( | InputIt && | first, |
| InputIt && | last, | ||
| T & | i ) |
Wrapper around the other read_varint, Sets template parameters for you.
| std::enable_if< std::is_integral< T >::value &&std::is_unsigned< T >::value &&0<=bits &&bits<=std::numeric_limits< T >::digits, int >::type tools::read_varint | ( | InputIt && | first, |
| InputIt && | last, | ||
| T & | write ) |
reads in the varint that is pointed to by InputIt into write
| void tools::reattach_blockchain | ( | hashchain & | blockchain, |
| wallet2::detached_blockchain_data & | dbd ) |
std::rename wrapper for nix and something strange for windows.
| bool tools::sanitize_locale | ( | ) |
| bool tools::serialize_obj_to_file | ( | t_object & | obj, |
| const std::string & | file_path ) |
| void tools::set_max_concurrency | ( | unsigned | n | ) |
| void tools::set_performance_timer_log_level | ( | el::Level | level | ) |
| void tools::set_stack_trace_log | ( | const std::string & | log | ) |
| void tools::set_strict_default_file_permissions | ( | bool | strict | ) |
|
static |
| bool tools::sha256sum | ( | const std::string & | filename, |
| crypto::hash & | hash ) |
Creates a SHA-256 digest of a file's contents, equivalent to the sha256sum command in Linux.
| [in] | filename | path to target file |
| [out] | hash | where message digest will be written to |
| ios_base::failure | if after the file is successfully opened, an error occurs during reading |
| bool tools::sha256sum | ( | const uint8_t * | data, |
| size_t | len, | ||
| crypto::hash & | hash ) |
Creates a SHA-256 digest of a data buffer.
| [in] | data | pointer to the buffer |
| [in] | len | size of the buffer in bytes |
| [out] | hash | where message digest will be written to |
| std::vector< std::pair< std::string, size_t > > tools::split_line_by_width | ( | const std::string & | s, |
| size_t | columns ) |
| std::vector< std::pair< std::string, size_t > > tools::split_string_by_width | ( | const std::string & | s, |
| size_t | columns ) |
|
inline |
| boost::optional< std::string > tools::tlsa_to_string | ( | const char * | src, |
| size_t | len ) |
|
static |
| boost::optional< std::string > tools::txt_to_string | ( | const char * | src, |
| size_t | len ) |
|
static |
| bool tools::unserialize_obj_from_file | ( | t_object & | obj, |
| const std::string & | file_path ) |
| void tools::validate_background_cache_password_usage | ( | const tools::wallet2::BackgroundSyncType | background_sync_type, |
| const boost::optional< epee::wipeable_string > & | background_cache_password, | ||
| const bool | multisig, | ||
| const bool | watch_only, | ||
| const bool | key_on_device ) |
| std::enable_if< std::is_integral< T >::value &&std::is_unsigned< T >::value, void >::type tools::write_varint | ( | OutputIt && | dest, |
| T | i ) |
writes a varint to a stream.
|
constexpr |
|
constexpr |
|
constexpr |
|
constexpr |
|
constexpr |
| el::Level tools::performance_timer_log_level = el::Level::Info |
|
static |
|
staticconstexpr |
|
staticconstexpr |
|
staticconstexpr |
|
staticconstexpr |
|
static |