Monero
Loading...
Searching...
No Matches
tools::wallet Namespace Reference

Functions

static const std::vector< cryptonote::tx_destination_entry > & get_tx_destinations (const wallet2::tx_construction_data &tx)
static const std::vector< cryptonote::tx_destination_entry > & get_tx_destinations (const wallet2::pending_tx &tx)
static const std::vector< cryptonote::tx_source_entry > & get_tx_sources (const wallet2::tx_construction_data &tx)
static const std::vector< cryptonote::tx_source_entry > & get_tx_sources (const wallet2::pending_tx &tx)
template<typename T>
static bool check_consistent_ins_outs_impl (const std::vector< T > &txes)
static void sanity_check_unsigned_tx (const wallet2::tx_construction_data &tx, const cryptonote::account_keys &account_keys, const std::unordered_map< crypto::public_key, cryptonote::subaddress_index > &subaddresses)
static void validate_tx_outs (const wallet2::pending_tx &ptx, const std::vector< cryptonote::txout_to_tagged_key > &ext_outputs, const crypto::secret_key &k_view, const cryptonote::tx_destination_entry &change, const std::vector< cryptonote::tx_destination_entry > &dests, const crypto::secret_key &tx_key, const std::vector< crypto::secret_key > &additional_tx_keys, crypto::public_key &tx_pubkey_out, std::vector< crypto::public_key > &tx_additional_pubkeys_out)
static void reconstruct_payment_id (const std::string &extracted_payment_id, const boost::optional< crypto::hash8 > &parsed_to_check, const cryptonote::account_public_address &change_addr, const std::vector< cryptonote::tx_destination_entry > &dests, const boost::optional< crypto::secret_key > tx_key, const std::vector< cryptonote::tx_extra_field > &tx_extra_fields)
void sanity_check_pending_tx (const wallet2::pending_tx &ptx, const cryptonote::network_type nettype, const cryptonote::account_keys &account_keys, const std::unordered_map< crypto::public_key, cryptonote::subaddress_index > &subaddresses, const std::vector< wallet2::transfer_details > &transfers, const bool redacted, const boost::optional< std::function< const crypto::key_image(const size_t)> > &transfer_ki_resolver, const bool allow_read_only)
void check_consistent_ins_outs (const std::vector< wallet2::tx_construction_data > &txes)
void check_consistent_ins_outs (const std::vector< wallet2::pending_tx > &txes)
void sanity_check_tx_construction_data (const wallet2::tx_construction_data &tx)
void sanity_check_unsigned_tx_set (const std::vector< wallet2::tx_construction_data > &txes, const cryptonote::account_keys &account_keys, const std::unordered_map< crypto::public_key, cryptonote::subaddress_index > &subaddresses)
void sanity_check_pending_tx_set (const std::vector< wallet2::pending_tx > &ptxs, const cryptonote::network_type nettype, const cryptonote::account_keys &account_keys, const std::unordered_map< crypto::public_key, cryptonote::subaddress_index > &subaddresses, const std::vector< wallet2::transfer_details > &transfers, const bool redacted, const boost::optional< std::function< const crypto::key_image(const size_t)> > &transfer_ki_resolver, const bool allow_read_only)

Function Documentation

◆ check_consistent_ins_outs() [1/2]

void tools::wallet::check_consistent_ins_outs ( const std::vector< wallet2::pending_tx > & txes)

◆ check_consistent_ins_outs() [2/2]

void tools::wallet::check_consistent_ins_outs ( const std::vector< wallet2::tx_construction_data > & txes)

◆ check_consistent_ins_outs_impl()

template<typename T>
bool tools::wallet::check_consistent_ins_outs_impl ( const std::vector< T > & txes)
static

◆ get_tx_destinations() [1/2]

const std::vector< cryptonote::tx_destination_entry > & tools::wallet::get_tx_destinations ( const wallet2::pending_tx & tx)
static

◆ get_tx_destinations() [2/2]

const std::vector< cryptonote::tx_destination_entry > & tools::wallet::get_tx_destinations ( const wallet2::tx_construction_data & tx)
static

◆ get_tx_sources() [1/2]

const std::vector< cryptonote::tx_source_entry > & tools::wallet::get_tx_sources ( const wallet2::pending_tx & tx)
static

◆ get_tx_sources() [2/2]

const std::vector< cryptonote::tx_source_entry > & tools::wallet::get_tx_sources ( const wallet2::tx_construction_data & tx)
static

◆ reconstruct_payment_id()

void tools::wallet::reconstruct_payment_id ( const std::string & extracted_payment_id,
const boost::optional< crypto::hash8 > & parsed_to_check,
const cryptonote::account_public_address & change_addr,
const std::vector< cryptonote::tx_destination_entry > & dests,
const boost::optional< crypto::secret_key > tx_key,
const std::vector< cryptonote::tx_extra_field > & tx_extra_fields )
static

◆ sanity_check_pending_tx()

void tools::wallet::sanity_check_pending_tx ( const wallet2::pending_tx & ptx,
const cryptonote::network_type nettype,
const cryptonote::account_keys & account_keys,
const std::unordered_map< crypto::public_key, cryptonote::subaddress_index > & subaddresses,
const std::vector< wallet2::transfer_details > & transfers,
const bool redacted,
const boost::optional< std::function< const crypto::key_image(const size_t)> > & transfer_ki_resolver,
const bool allow_read_only )

brief: sanity_check_pending_tx - validate pending_tx consistency with itself and with with transfer_details Assumes ptx version is >= v16. WARNING: Unable to verify destination addresses that are URLs and not explicit addresses. WARNING: Due to upstream chaos, we are unable to reliably validate that tx_construction_data::extra matches with ptx.tx.tx_extra. NOTE: Due to upstream inconsistencies, we are unable to validate mixRing reliably (it is not serialized in final txs). param: ptx - the pending_tx to validate param: nettype - the network that will receive the tx (e.g. mainnet/stressnet/testnet) param: account_keys - the keys of the tx author (only the private view key and base address are needed) param: subaddresses - the tx author's subaddress map param: transfers - transfer_details from inside wallet2 (required because ptx includes transfer references) param: redacted - if true then:

  • We assume ptx.tx_key and ptx.additional_tx_keys are nullified. param: transfer_ki_resolver - if not-std::nullopt then this will be used to access transfers key images to verify key images line up to wallets' imported key images callback: const crypto::key_image your_lambda(const size_t transfer_idx)
  • The callback should panic if transfer_idx is invalid. param: allow_read_only - if true then ptx transfers may be already-spent or frozen

◆ sanity_check_pending_tx_set()

void tools::wallet::sanity_check_pending_tx_set ( const std::vector< wallet2::pending_tx > & ptxs,
const cryptonote::network_type nettype,
const cryptonote::account_keys & account_keys,
const std::unordered_map< crypto::public_key, cryptonote::subaddress_index > & subaddresses,
const std::vector< wallet2::transfer_details > & transfers,
const bool redacted,
const boost::optional< std::function< const crypto::key_image(const size_t)> > & transfer_ki_resolver,
const bool allow_read_only )

◆ sanity_check_tx_construction_data()

void tools::wallet::sanity_check_tx_construction_data ( const wallet2::tx_construction_data & tx)

◆ sanity_check_unsigned_tx()

void tools::wallet::sanity_check_unsigned_tx ( const wallet2::tx_construction_data & tx,
const cryptonote::account_keys & account_keys,
const std::unordered_map< crypto::public_key, cryptonote::subaddress_index > & subaddresses )
static

◆ sanity_check_unsigned_tx_set()

void tools::wallet::sanity_check_unsigned_tx_set ( const std::vector< wallet2::tx_construction_data > & txes,
const cryptonote::account_keys & account_keys,
const std::unordered_map< crypto::public_key, cryptonote::subaddress_index > & subaddresses )

◆ validate_tx_outs()

void tools::wallet::validate_tx_outs ( const wallet2::pending_tx & ptx,
const std::vector< cryptonote::txout_to_tagged_key > & ext_outputs,
const crypto::secret_key & k_view,
const cryptonote::tx_destination_entry & change,
const std::vector< cryptonote::tx_destination_entry > & dests,
const crypto::secret_key & tx_key,
const std::vector< crypto::secret_key > & additional_tx_keys,
crypto::public_key & tx_pubkey_out,
std::vector< crypto::public_key > & tx_additional_pubkeys_out )
static