Monero
Loading...
Searching...
No Matches
wallet2.cpp File Reference
#include <algorithm>
#include <numeric>
#include <tuple>
#include <queue>
#include <boost/format.hpp>
#include <boost/optional/optional.hpp>
#include <boost/algorithm/string/classification.hpp>
#include <boost/algorithm/string/trim.hpp>
#include <boost/algorithm/string/split.hpp>
#include <boost/algorithm/string/join.hpp>
#include <boost/algorithm/string/predicate.hpp>
#include <boost/asio/ip/address.hpp>
#include <boost/range/adaptor/transformed.hpp>
#include <boost/preprocessor/stringize.hpp>
#include <openssl/evp.h>
#include "include_base_utils.h"
#include "cryptonote_config.h"
#include "hardforks/hardforks.h"
#include "cryptonote_core/tx_sanity_check.h"
#include "wallet_rpc_helpers.h"
#include "wallet2.h"
#include "wallet_args.h"
#include "cryptonote_basic/cryptonote_format_utils.h"
#include "net/parse.h"
#include "rpc/core_rpc_server_commands_defs.h"
#include "rpc/core_rpc_server_error_codes.h"
#include "rpc/rpc_payment_signature.h"
#include "rpc/rpc_payment_costs.h"
#include "misc_language.h"
#include "cryptonote_basic/cryptonote_basic_impl.h"
#include "multisig/multisig.h"
#include "multisig/multisig_account.h"
#include "multisig/multisig_kex_msg.h"
#include "multisig/multisig_tx_builder_ringct.h"
#include "common/boost_serialization_helper.h"
#include "common/command_line.h"
#include "common/threadpool.h"
#include "int-util.h"
#include "profile_tools.h"
#include "crypto/crypto.h"
#include "serialization/binary_utils.h"
#include "serialization/string.h"
#include "cryptonote_basic/blobdatatype.h"
#include "mnemonics/electrum-words.h"
#include "common/i18n.h"
#include "common/util.h"
#include "common/apply_permutation.h"
#include "rapidjson/document.h"
#include "rapidjson/writer.h"
#include "rapidjson/stringbuffer.h"
#include "common/json_util.h"
#include "memwipe.h"
#include "common/base58.h"
#include "common/combinator.h"
#include "common/dns_utils.h"
#include "common/notify.h"
#include "common/perf_timer.h"
#include "ringct/rctSigs.h"
#include "ringdb.h"
#include "device/device_cold.hpp"
#include "device_trezor/device_trezor.hpp"
#include "net/socks_connect.h"
#include "crypto/keccak.h"
#include "crypto/crypto-ops.h"

Namespaces

namespace  tools
 Various Tools.

Macros

#define MONERO_DEFAULT_LOG_CATEGORY   "wallet.wallet2"
#define APPROXIMATE_INPUT_BYTES   80
#define TX_WEIGHT_TARGET(bytes)
#define UNSIGNED_TX_PREFIX   "Monero unsigned tx set\005"
#define SIGNED_TX_PREFIX   "Monero signed tx set\005"
#define MULTISIG_UNSIGNED_TX_PREFIX   "Monero multisig unsigned tx set\001"
#define RECENT_OUTPUT_RATIO   (0.5)
#define RECENT_OUTPUT_DAYS   (1.8)
#define RECENT_OUTPUT_ZONE   ((time_t)(RECENT_OUTPUT_DAYS * 86400))
#define RECENT_OUTPUT_BLOCKS   (RECENT_OUTPUT_DAYS * 720)
#define FEE_ESTIMATE_GRACE_BLOCKS   10
#define SECOND_OUTPUT_RELATEDNESS_THRESHOLD   0.0f
#define SUBADDRESS_LOOKAHEAD_MAJOR   50
#define SUBADDRESS_LOOKAHEAD_MINOR   200
#define KEY_IMAGE_EXPORT_FILE_MAGIC   "Monero key image export\003"
#define MULTISIG_EXPORT_FILE_MAGIC   "Monero multisig export\001"
#define OUTPUT_EXPORT_FILE_MAGIC   "Monero output export\004"
#define SEGREGATION_FORK_HEIGHT   99999999
#define TESTNET_SEGREGATION_FORK_HEIGHT   99999999
#define STAGENET_SEGREGATION_FORK_HEIGHT   99999999
#define SEGREGATION_FORK_VICINITY   1500 /* blocks */
#define FIRST_REFRESH_GRANULARITY   1024
#define GAMMA_SHAPE   19.28
#define GAMMA_SCALE   (1/1.61)
#define DEFAULT_MIN_OUTPUT_COUNT   5
#define DEFAULT_MIN_OUTPUT_VALUE   (2*COIN)
#define DEFAULT_INACTIVITY_LOCK_TIMEOUT   90
#define IGNORE_LONG_PAYMENT_ID_FROM_BLOCK_VERSION   12
#define DEFAULT_UNLOCK_TIME   (CRYPTONOTE_DEFAULT_TX_SPENDABLE_AGE * DIFFICULTY_TARGET_V2)
#define RECENT_SPEND_WINDOW   (15 * DIFFICULTY_TARGET_V2)
#define CMPF(f)

Functions

void tools::reattach_blockchain (hashchain &blockchain, wallet2::detached_blockchain_data &dbd)
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)
static uint64_t tools::decodeRct (const rct::rctSig &rv, const crypto::key_derivation &derivation, unsigned int i, rct::key &mask, hw::device &hwdev)
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)
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)
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)
void tools::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 > tools::outs_unique (const std::vector< std::vector< tools::wallet2::get_outs_entry > > &outs)
static uint32_t tools::get_count_above (const std::vector< wallet2::transfer_details > &transfers, const std::vector< size_t > &indices, uint64_t threshold)
static crypto::hash tools::get_message_hash (const std::string &data, const crypto::public_key &spend_key, const crypto::public_key &view_key, const uint8_t mode)

Variables

static const std::string MULTISIG_SIGNATURE_MAGIC = "SigMultisigPkV1"
static const std::string ASCII_OUTPUT_MAGIC = "MoneroAsciiDataV1"
static const std::string BACKGROUND_WALLET_SUFFIX = ".background"

Macro Definition Documentation

◆ APPROXIMATE_INPUT_BYTES

#define APPROXIMATE_INPUT_BYTES   80

◆ CMPF

#define CMPF ( f)
Value:
if (!(td.f == org_td.f)) goto process

◆ DEFAULT_INACTIVITY_LOCK_TIMEOUT

#define DEFAULT_INACTIVITY_LOCK_TIMEOUT   90

◆ DEFAULT_MIN_OUTPUT_COUNT

#define DEFAULT_MIN_OUTPUT_COUNT   5

◆ DEFAULT_MIN_OUTPUT_VALUE

#define DEFAULT_MIN_OUTPUT_VALUE   (2*COIN)

◆ DEFAULT_UNLOCK_TIME

#define DEFAULT_UNLOCK_TIME   (CRYPTONOTE_DEFAULT_TX_SPENDABLE_AGE * DIFFICULTY_TARGET_V2)

◆ FEE_ESTIMATE_GRACE_BLOCKS

#define FEE_ESTIMATE_GRACE_BLOCKS   10

◆ FIRST_REFRESH_GRANULARITY

#define FIRST_REFRESH_GRANULARITY   1024

◆ GAMMA_SCALE

#define GAMMA_SCALE   (1/1.61)

◆ GAMMA_SHAPE

#define GAMMA_SHAPE   19.28

◆ IGNORE_LONG_PAYMENT_ID_FROM_BLOCK_VERSION

#define IGNORE_LONG_PAYMENT_ID_FROM_BLOCK_VERSION   12

◆ KEY_IMAGE_EXPORT_FILE_MAGIC

#define KEY_IMAGE_EXPORT_FILE_MAGIC   "Monero key image export\003"

◆ MONERO_DEFAULT_LOG_CATEGORY

#define MONERO_DEFAULT_LOG_CATEGORY   "wallet.wallet2"

◆ MULTISIG_EXPORT_FILE_MAGIC

#define MULTISIG_EXPORT_FILE_MAGIC   "Monero multisig export\001"

◆ MULTISIG_UNSIGNED_TX_PREFIX

#define MULTISIG_UNSIGNED_TX_PREFIX   "Monero multisig unsigned tx set\001"

◆ OUTPUT_EXPORT_FILE_MAGIC

#define OUTPUT_EXPORT_FILE_MAGIC   "Monero output export\004"

◆ RECENT_OUTPUT_BLOCKS

#define RECENT_OUTPUT_BLOCKS   (RECENT_OUTPUT_DAYS * 720)

◆ RECENT_OUTPUT_DAYS

#define RECENT_OUTPUT_DAYS   (1.8)

◆ RECENT_OUTPUT_RATIO

#define RECENT_OUTPUT_RATIO   (0.5)

◆ RECENT_OUTPUT_ZONE

#define RECENT_OUTPUT_ZONE   ((time_t)(RECENT_OUTPUT_DAYS * 86400))

◆ RECENT_SPEND_WINDOW

#define RECENT_SPEND_WINDOW   (15 * DIFFICULTY_TARGET_V2)

◆ SECOND_OUTPUT_RELATEDNESS_THRESHOLD

#define SECOND_OUTPUT_RELATEDNESS_THRESHOLD   0.0f

◆ SEGREGATION_FORK_HEIGHT

#define SEGREGATION_FORK_HEIGHT   99999999

◆ SEGREGATION_FORK_VICINITY

#define SEGREGATION_FORK_VICINITY   1500 /* blocks */

◆ SIGNED_TX_PREFIX

#define SIGNED_TX_PREFIX   "Monero signed tx set\005"

◆ STAGENET_SEGREGATION_FORK_HEIGHT

#define STAGENET_SEGREGATION_FORK_HEIGHT   99999999

◆ SUBADDRESS_LOOKAHEAD_MAJOR

#define SUBADDRESS_LOOKAHEAD_MAJOR   50

◆ SUBADDRESS_LOOKAHEAD_MINOR

#define SUBADDRESS_LOOKAHEAD_MINOR   200

◆ TESTNET_SEGREGATION_FORK_HEIGHT

#define TESTNET_SEGREGATION_FORK_HEIGHT   99999999

◆ TX_WEIGHT_TARGET

#define TX_WEIGHT_TARGET ( bytes)
Value:
(bytes*2/3)

◆ UNSIGNED_TX_PREFIX

#define UNSIGNED_TX_PREFIX   "Monero unsigned tx set\005"

Variable Documentation

◆ ASCII_OUTPUT_MAGIC

const std::string ASCII_OUTPUT_MAGIC = "MoneroAsciiDataV1"
static

◆ BACKGROUND_WALLET_SUFFIX

const std::string BACKGROUND_WALLET_SUFFIX = ".background"
static

◆ MULTISIG_SIGNATURE_MAGIC

const std::string MULTISIG_SIGNATURE_MAGIC = "SigMultisigPkV1"
static