aboutsummaryrefslogtreecommitdiff
path: root/src/wallet/api
diff options
context:
space:
mode:
authortobtoht <thotbot@protonmail.com>2021-06-04 13:37:23 +0200
committertobtoht <thotbot@protonmail.com>2021-06-04 13:41:10 +0200
commit6914d5b914ab3df9301d7f5ac5c0f7a2703e560f (patch)
tree5ef6dd02fad4d8d6fd24c4f830490d7577070f73 /src/wallet/api
parentMerge pull request #7735 (diff)
downloadmonero-6914d5b914ab3df9301d7f5ac5c0f7a2703e560f.tar.xz
wallet_api: move adjust_mixin call within try block
Diffstat (limited to 'src/wallet/api')
-rw-r--r--src/wallet/api/wallet.cpp11
1 files changed, 3 insertions, 8 deletions
diff --git a/src/wallet/api/wallet.cpp b/src/wallet/api/wallet.cpp
index db3049f9e..6a96d3db3 100644
--- a/src/wallet/api/wallet.cpp
+++ b/src/wallet/api/wallet.cpp
@@ -58,7 +58,6 @@ namespace Monero {
namespace {
// copy-pasted from simplewallet
- static const size_t DEFAULT_MIXIN = 6;
static const int DEFAULT_REFRESH_INTERVAL_MILLIS = 1000 * 10;
// limit maximum refresh interval as one minute
static const int MAX_REFRESH_INTERVAL_MILLIS = 1000 * 60 * 1;
@@ -1491,13 +1490,6 @@ PendingTransaction *WalletImpl::createTransactionMultDest(const std::vector<stri
cryptonote::address_parse_info info;
- // indicates if dst_addr is integrated address (address + payment_id)
- // TODO: (https://bitcointalk.org/index.php?topic=753252.msg9985441#msg9985441)
- size_t fake_outs_count = mixin_count > 0 ? mixin_count : m_wallet->default_mixin();
- if (fake_outs_count == 0)
- fake_outs_count = DEFAULT_MIXIN;
- fake_outs_count = m_wallet->adjust_mixin(fake_outs_count);
-
uint32_t adjusted_priority = m_wallet->adjust_priority(static_cast<uint32_t>(priority));
PendingTransactionImpl * transaction = new PendingTransactionImpl(*this);
@@ -1563,6 +1555,9 @@ PendingTransaction *WalletImpl::createTransactionMultDest(const std::vector<stri
break;
}
try {
+ size_t fake_outs_count = mixin_count > 0 ? mixin_count : m_wallet->default_mixin();
+ fake_outs_count = m_wallet->adjust_mixin(mixin_count);
+
if (amount) {
transaction->m_pending_tx = m_wallet->create_transactions_2(dsts, fake_outs_count, 0 /* unlock_time */,
adjusted_priority,