Electroneum
Classes | Namespaces | Macros | Functions | Variables
wallet2.cpp File Reference
#include <random>
#include <tuple>
#include <boost/format.hpp>
#include <boost/optional/optional.hpp>
#include <boost/utility/value_init.hpp>
#include <boost/algorithm/string/join.hpp>
#include "include_base_utils.h"
#include "cryptonote_config.h"
#include "wallet2.h"
#include "wallet2_api.h"
#include "cryptonote_basic/cryptonote_format_utils.h"
#include "rpc/core_rpc_server_commands_defs.h"
#include "misc_language.h"
#include "cryptonote_basic/cryptonote_basic_impl.h"
#include "common/boost_serialization_helper.h"
#include "common/command_line.h"
#include "profile_tools.h"
#include "crypto/crypto.h"
#include "serialization/binary_utils.h"
#include "cryptonote_protocol/blobdatatype.h"
#include "mnemonics/electrum-words.h"
#include "common/i18n.h"
#include "common/util.h"
#include "rapidjson/document.h"
#include "rapidjson/writer.h"
#include "rapidjson/stringbuffer.h"
#include "common/json_util.h"
#include "common/base58.h"
#include "common/scoped_message_writer.h"
#include "ringct/rctSigs.h"
#include "wallet/micro_core/MicroCore.h"
#include "crypto/keccak.h"
#include "crypto/crypto-ops.h"
Include dependency graph for wallet2.cpp:

Classes

struct  anonymous_namespace{wallet2.cpp}::options
 

Namespaces

 anonymous_namespace{wallet2.cpp}
 
 tools
 Various Tools.
 
 tools::anonymous_namespace{wallet2.cpp}
 

Macros

#define ELECTRONEUM_DEFAULT_LOG_CATEGORY   "wallet.wallet2"
 
#define APPROXIMATE_INPUT_BYTES   80
 
#define TX_SIZE_TARGET(bytes)   (bytes*2/3)
 
#define CHACHA8_KEY_TAIL   0x8c
 
#define UNSIGNED_TX_PREFIX   "Electroneum unsigned tx set\003"
 
#define SIGNED_TX_PREFIX   "Electroneum signed tx set\003"
 
#define RECENT_OUTPUT_RATIO   (0.5)
 
#define RECENT_OUTPUT_ZONE   ((time_t)(1.8 * 86400))
 
#define FEE_ESTIMATE_GRACE_BLOCKS   10
 
#define SECOND_OUTPUT_RELATEDNESS_THRESHOLD   0.0f
 
#define KILL_IOSERVICE()
 
#define KEY_IMAGE_EXPORT_FILE_MAGIC   "Electroneum key image export\002"
 

Functions

void anonymous_namespace{wallet2.cpp}::do_prepare_file_names (const std::string &file_path, std::string &keys_file, std::string &wallet_file)
 
uint64_t anonymous_namespace{wallet2.cpp}::calculate_fee (uint64_t fee_per_kb, size_t bytes, uint64_t fee_multiplier)
 
uint64_t anonymous_namespace{wallet2.cpp}::calculate_fee (uint64_t fee_per_kb, const cryptonote::blobdata &blob, uint64_t fee_multiplier)
 
std::unique_ptr< tools::wallet2anonymous_namespace{wallet2.cpp}::make_basic (const boost::program_options::variables_map &vm, const options &opts, etneg::MicroCore *core=nullptr, cryptonote::Blockchain *blockchain_storage=nullptr)
 
boost::optional< tools::password_containeranonymous_namespace{wallet2.cpp}::get_password (const boost::program_options::variables_map &vm, const options &opts, const bool verify)
 
std::unique_ptr< tools::wallet2anonymous_namespace{wallet2.cpp}::generate_from_json (const std::string &json_file, const boost::program_options::variables_map &vm, const options &opts, etneg::MicroCore *core=nullptr, cryptonote::Blockchain *blockchain_storage=nullptr)
 
static void anonymous_namespace{wallet2.cpp}::throw_on_rpc_response_error (const boost::optional< std::string > &status, const char *method)
 
std::string anonymous_namespace{wallet2.cpp}::strjoin (const std::vector< size_t > &V, const char *sep)
 
static uint64_t tools::decodeRct (const rct::rctSig &rv, const crypto::public_key &pub, const crypto::secret_key &sec, unsigned int i, rct::key &mask)
 
bool tools::anonymous_namespace{wallet2.cpp}::verify_keys (const crypto::secret_key &sec, const crypto::public_key &expected_pub)
 
template<typename T >
T tools::anonymous_namespace{wallet2.cpp}::pop_index (std::vector< T > &vec, size_t idx)
 
template<typename T >
T tools::anonymous_namespace{wallet2.cpp}::pop_random_value (std::vector< T > &vec)
 
template<typename T >
T tools::anonymous_namespace{wallet2.cpp}::pop_back (std::vector< T > &vec)
 
template<typename T >
void tools::anonymous_namespace{wallet2.cpp}::pop_if_present (std::vector< T > &vec, T e)
 
std::vector< std::vector< cryptonote::tx_destination_entry > > tools::anonymous_namespace{wallet2.cpp}::split_amounts (std::vector< cryptonote::tx_destination_entry > dsts, size_t num_splits)
 
static size_t tools::estimate_rct_tx_size (int n_inputs, int mixin, int n_outputs)
 
static size_t tools::estimate_tx_size (bool use_rct, int n_inputs, int mixin, int n_outputs)
 
static uint32_t tools::get_count_above (const std::vector< wallet2::transfer_details > &transfers, const std::vector< size_t > &indices, uint64_t threshold)
 

Variables

const size_t tools::MAX_SPLIT_ATTEMPTS = 30
 

Macro Definition Documentation

◆ APPROXIMATE_INPUT_BYTES

#define APPROXIMATE_INPUT_BYTES   80

◆ CHACHA8_KEY_TAIL

#define CHACHA8_KEY_TAIL   0x8c

◆ ELECTRONEUM_DEFAULT_LOG_CATEGORY

#define ELECTRONEUM_DEFAULT_LOG_CATEGORY   "wallet.wallet2"

◆ FEE_ESTIMATE_GRACE_BLOCKS

#define FEE_ESTIMATE_GRACE_BLOCKS   10

◆ KEY_IMAGE_EXPORT_FILE_MAGIC

#define KEY_IMAGE_EXPORT_FILE_MAGIC   "Electroneum key image export\002"

◆ KILL_IOSERVICE

#define KILL_IOSERVICE ( )
Value:
do { \
work.reset(); \
while (!ioservice.stopped()) ioservice.poll(); \
threadpool.join_all(); \
ioservice.stop(); \
} while(0)

◆ RECENT_OUTPUT_RATIO

#define RECENT_OUTPUT_RATIO   (0.5)

◆ RECENT_OUTPUT_ZONE

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

◆ SECOND_OUTPUT_RELATEDNESS_THRESHOLD

#define SECOND_OUTPUT_RELATEDNESS_THRESHOLD   0.0f

◆ SIGNED_TX_PREFIX

#define SIGNED_TX_PREFIX   "Electroneum signed tx set\003"

◆ TX_SIZE_TARGET

#define TX_SIZE_TARGET (   bytes)    (bytes*2/3)

◆ UNSIGNED_TX_PREFIX

#define UNSIGNED_TX_PREFIX   "Electroneum unsigned tx set\003"