aboutsummaryrefslogtreecommitdiff
path: root/src/wallet/wallet2.cpp
diff options
context:
space:
mode:
authorluigi1111 <luigi1111w@gmail.com>2020-03-31 15:12:48 -0500
committerluigi1111 <luigi1111w@gmail.com>2020-03-31 15:12:48 -0500
commitd0065f3063c365ac9a65a655f145382408033c4f (patch)
tree160d7bcf555df0ecba8ee925bbdb5e1ba4ace964 /src/wallet/wallet2.cpp
parentMerge pull request #6301 (diff)
parentwallet2_api: implement estimateTransactionFee (diff)
downloadmonero-d0065f3063c365ac9a65a655f145382408033c4f.tar.xz
Merge pull request #6302
dab604e wallet2_api: implement estimateTransactionFee (xiphon)
Diffstat (limited to 'src/wallet/wallet2.cpp')
-rw-r--r--src/wallet/wallet2.cpp28
1 files changed, 14 insertions, 14 deletions
diff --git a/src/wallet/wallet2.cpp b/src/wallet/wallet2.cpp
index eaf185c63..5c9463bc7 100644
--- a/src/wallet/wallet2.cpp
+++ b/src/wallet/wallet2.cpp
@@ -896,20 +896,6 @@ uint8_t get_bulletproof_fork()
return 8;
}
-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, uint64_t base_fee, uint64_t fee_multiplier, uint64_t fee_quantization_mask)
-{
- if (use_per_byte_fee)
- {
- const size_t estimated_tx_weight = estimate_tx_weight(use_rct, n_inputs, mixin, n_outputs, extra_size, bulletproof);
- return calculate_fee_from_weight(base_fee, estimated_tx_weight, fee_multiplier, fee_quantization_mask);
- }
- else
- {
- const size_t estimated_tx_size = estimate_tx_size(use_rct, n_inputs, mixin, n_outputs, extra_size, bulletproof);
- return calculate_fee(base_fee, estimated_tx_size, fee_multiplier);
- }
-}
-
uint64_t calculate_fee(bool use_per_byte_fee, const cryptonote::transaction &tx, size_t blob_size, uint64_t base_fee, uint64_t fee_multiplier, uint64_t fee_quantization_mask)
{
if (use_per_byte_fee)
@@ -7157,6 +7143,20 @@ bool wallet2::sign_multisig_tx_from_file(const std::string &filename, std::vecto
return sign_multisig_tx_to_file(exported_txs, filename, txids);
}
//----------------------------------------------------------------------------------------------------
+uint64_t wallet2::estimate_fee(bool use_per_byte_fee, bool use_rct, int n_inputs, int mixin, int n_outputs, size_t extra_size, bool bulletproof, uint64_t base_fee, uint64_t fee_multiplier, uint64_t fee_quantization_mask) const
+{
+ if (use_per_byte_fee)
+ {
+ const size_t estimated_tx_weight = estimate_tx_weight(use_rct, n_inputs, mixin, n_outputs, extra_size, bulletproof);
+ return calculate_fee_from_weight(base_fee, estimated_tx_weight, fee_multiplier, fee_quantization_mask);
+ }
+ else
+ {
+ const size_t estimated_tx_size = estimate_tx_size(use_rct, n_inputs, mixin, n_outputs, extra_size, bulletproof);
+ return calculate_fee(base_fee, estimated_tx_size, fee_multiplier);
+ }
+}
+
uint64_t wallet2::get_fee_multiplier(uint32_t priority, int fee_algorithm)
{
static const struct