mirror of
https://github.com/monero-project/monero.git
synced 2026-06-12 19:11:36 -07:00
wallet: Improve Fee Priority Code for Clarity
This commit is contained in:
+20
-11
@@ -71,6 +71,8 @@
|
||||
#include "common/password.h"
|
||||
#include "node_rpc_proxy.h"
|
||||
#include "message_store.h"
|
||||
#include "fee_priority.h"
|
||||
#include "fee_algorithm.h"
|
||||
|
||||
#undef MONERO_DEFAULT_LOG_CATEGORY
|
||||
#define MONERO_DEFAULT_LOG_CATEGORY "wallet.wallet2"
|
||||
@@ -1190,10 +1192,10 @@ private:
|
||||
bool parse_unsigned_tx_from_str(const std::string &unsigned_tx_st, unsigned_tx_set &exported_txs) const;
|
||||
bool load_tx(const std::string &signed_filename, std::vector<tools::wallet2::pending_tx> &ptx, std::function<bool(const signed_tx_set&)> accept_func = NULL);
|
||||
bool parse_tx_from_str(const std::string &signed_tx_st, std::vector<tools::wallet2::pending_tx> &ptx, std::function<bool(const signed_tx_set &)> accept_func);
|
||||
std::vector<wallet2::pending_tx> create_transactions_2(std::vector<cryptonote::tx_destination_entry> dsts, const size_t fake_outs_count, uint32_t priority, const std::vector<uint8_t>& extra, uint32_t subaddr_account, std::set<uint32_t> subaddr_indices, const unique_index_container& subtract_fee_from_outputs = {}); // pass subaddr_indices by value on purpose
|
||||
std::vector<wallet2::pending_tx> create_transactions_all(uint64_t below, const cryptonote::account_public_address &address, bool is_subaddress, const size_t outputs, const size_t fake_outs_count, uint32_t priority, const std::vector<uint8_t>& extra, uint32_t subaddr_account, std::set<uint32_t> subaddr_indices);
|
||||
std::vector<wallet2::pending_tx> create_transactions_single(const crypto::key_image &ki, const cryptonote::account_public_address &address, bool is_subaddress, const size_t outputs, const size_t fake_outs_count, uint32_t priority, const std::vector<uint8_t>& extra);
|
||||
std::vector<wallet2::pending_tx> create_transactions_from(const cryptonote::account_public_address &address, bool is_subaddress, const size_t outputs, std::vector<size_t> unused_transfers_indices, std::vector<size_t> unused_dust_indices, const size_t fake_outs_count, uint32_t priority, const std::vector<uint8_t>& extra);
|
||||
std::vector<wallet2::pending_tx> create_transactions_2(std::vector<cryptonote::tx_destination_entry> dsts, const size_t fake_outs_count, fee_priority priority, const std::vector<uint8_t>& extra, uint32_t subaddr_account, std::set<uint32_t> subaddr_indices, const unique_index_container& subtract_fee_from_outputs = {}); // pass subaddr_indices by value on purpose
|
||||
std::vector<wallet2::pending_tx> create_transactions_all(uint64_t below, const cryptonote::account_public_address &address, bool is_subaddress, const size_t outputs, const size_t fake_outs_count, fee_priority priority, const std::vector<uint8_t>& extra, uint32_t subaddr_account, std::set<uint32_t> subaddr_indices);
|
||||
std::vector<wallet2::pending_tx> create_transactions_single(const crypto::key_image &ki, const cryptonote::account_public_address &address, bool is_subaddress, const size_t outputs, const size_t fake_outs_count, fee_priority priority, const std::vector<uint8_t>& extra);
|
||||
std::vector<wallet2::pending_tx> create_transactions_from(const cryptonote::account_public_address &address, bool is_subaddress, const size_t outputs, std::vector<size_t> unused_transfers_indices, std::vector<size_t> unused_dust_indices, const size_t fake_outs_count, fee_priority priority, const std::vector<uint8_t>& extra);
|
||||
bool sanity_check(const std::vector<wallet2::pending_tx> &ptx_vector, const std::vector<cryptonote::tx_destination_entry>& dsts, const unique_index_container& subtract_fee_from_outputs = {}) const;
|
||||
void cold_tx_aux_import(const std::vector<pending_tx>& ptx, const std::vector<std::string>& tx_device_aux);
|
||||
void cold_sign_tx(const std::vector<pending_tx>& ptx_vector, signed_tx_set &exported_txs, std::vector<cryptonote::address_parse_info> &dsts_info, std::vector<std::string> & tx_device_aux);
|
||||
@@ -1432,8 +1434,8 @@ private:
|
||||
void store_tx_info(bool store) { m_store_tx_info = store; }
|
||||
uint32_t default_mixin() const { return m_default_mixin; }
|
||||
void default_mixin(uint32_t m) { m_default_mixin = m; }
|
||||
uint32_t get_default_priority() const { return m_default_priority; }
|
||||
void set_default_priority(uint32_t p) { m_default_priority = p; }
|
||||
fee_priority get_default_priority() const { return m_default_priority; }
|
||||
void set_default_priority(fee_priority p) { m_default_priority = p; }
|
||||
bool auto_refresh() const { return m_auto_refresh; }
|
||||
void auto_refresh(bool r) { m_auto_refresh = r; }
|
||||
AskPasswordType ask_password() const { return m_ask_password; }
|
||||
@@ -1539,7 +1541,7 @@ private:
|
||||
uint8_t get_current_hard_fork();
|
||||
void get_hard_fork_info(uint8_t version, uint64_t &earliest_height);
|
||||
bool use_fork_rules(uint8_t version, int64_t early_blocks = 0);
|
||||
int get_fee_algorithm();
|
||||
fee_algorithm get_fee_algorithm();
|
||||
|
||||
std::string get_wallet_file() const;
|
||||
std::string get_keys_file() const;
|
||||
@@ -1652,15 +1654,22 @@ private:
|
||||
std::vector<std::pair<uint64_t, uint64_t>> estimate_backlog(uint64_t min_tx_weight, uint64_t max_tx_weight, const std::vector<uint64_t> &fees);
|
||||
|
||||
static uint64_t estimate_fee(bool use_per_byte_fee, bool use_rct, int n_inputs, int mixin, int n_outputs, size_t extra_size, bool bulletproof, bool clsag, bool bulletproof_plus, bool use_view_tags, uint64_t base_fee, uint64_t fee_quantization_mask);
|
||||
uint64_t get_fee_multiplier(uint32_t priority, int fee_algorithm = -1);
|
||||
uint64_t get_base_fee(uint32_t priority);
|
||||
uint64_t get_fee_multiplier(fee_priority priority, fee_algorithm fee_algorithm = fee_algorithm::Unset);
|
||||
uint64_t get_base_fee(fee_priority priority);
|
||||
uint64_t get_base_fee();
|
||||
uint64_t get_fee_quantization_mask();
|
||||
uint64_t get_min_ring_size();
|
||||
uint64_t get_max_ring_size();
|
||||
uint64_t adjust_mixin(uint64_t mixin);
|
||||
|
||||
uint32_t adjust_priority(uint32_t priority);
|
||||
fee_priority adjust_priority(fee_priority priority);
|
||||
|
||||
/*
|
||||
The overloads taking in an integer is kept for backwards compatibility, as this is called from wallet.cpp
|
||||
after casting from a type (PendingTransaction::FeePriority) which I don't want to touch.
|
||||
*/
|
||||
fee_priority adjust_priority(uint32_t priority);
|
||||
uint64_t get_base_fee(uint32_t);
|
||||
|
||||
bool is_unattended() const { return m_unattended; }
|
||||
|
||||
@@ -1959,7 +1968,7 @@ private:
|
||||
bool m_print_ring_members;
|
||||
bool m_store_tx_info; /*!< request txkey to be returned in RPC, and store in the wallet cache file */
|
||||
uint32_t m_default_mixin;
|
||||
uint32_t m_default_priority;
|
||||
fee_priority m_default_priority;
|
||||
RefreshType m_refresh_type;
|
||||
bool m_auto_refresh;
|
||||
bool m_first_refresh_done;
|
||||
|
||||
Reference in New Issue
Block a user