From 30c44bce0627260134d3606a9a6d0b453aad763d Mon Sep 17 00:00:00 2001 From: stoffu Date: Mon, 15 Jan 2018 12:05:16 +0900 Subject: wallet: automatically use low priority if safe (no backlog & recent blocks not full) --- src/wallet/api/wallet.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'src/wallet/api/wallet.cpp') diff --git a/src/wallet/api/wallet.cpp b/src/wallet/api/wallet.cpp index fcf5c8844..82948081e 100644 --- a/src/wallet/api/wallet.cpp +++ b/src/wallet/api/wallet.cpp @@ -1074,6 +1074,8 @@ PendingTransaction *WalletImpl::createTransaction(const string &dst_addr, const if (fake_outs_count == 0) fake_outs_count = DEFAULT_MIXIN; + uint32_t adjusted_priority = m_wallet->adjust_priority(static_cast(priority)); + PendingTransactionImpl * transaction = new PendingTransactionImpl(*this); do { @@ -1133,7 +1135,7 @@ PendingTransaction *WalletImpl::createTransaction(const string &dst_addr, const de.is_subaddress = info.is_subaddress; dsts.push_back(de); transaction->m_pending_tx = m_wallet->create_transactions_2(dsts, fake_outs_count, 0 /* unlock_time */, - static_cast(priority), + adjusted_priority, extra, subaddr_account, subaddr_indices, m_trustedDaemon); } else { // for the GUI, sweep_all (i.e. amount set as "(all)") will always sweep all the funds in all the addresses @@ -1143,7 +1145,7 @@ PendingTransaction *WalletImpl::createTransaction(const string &dst_addr, const subaddr_indices.insert(index); } transaction->m_pending_tx = m_wallet->create_transactions_all(0, info.address, info.is_subaddress, fake_outs_count, 0 /* unlock_time */, - static_cast(priority), + adjusted_priority, extra, subaddr_account, subaddr_indices, m_trustedDaemon); } -- cgit v1.2.3