From 15ebc44020a5ef39ffaccd6c087dcb0e6b2c3bd2 Mon Sep 17 00:00:00 2001 From: Andrew Chow Date: Mon, 7 Nov 2022 18:22:58 -0500 Subject: [PATCH] interfaces: Expose CreateRateBumpTransaction's orig_change_pos --- src/interfaces/wallet.h | 3 ++- src/qt/walletmodel.cpp | 2 +- src/wallet/interfaces.cpp | 5 +++-- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/src/interfaces/wallet.h b/src/interfaces/wallet.h index df1ced48a71..c7195462e8b 100644 --- a/src/interfaces/wallet.h +++ b/src/interfaces/wallet.h @@ -173,7 +173,8 @@ class Wallet std::vector& errors, CAmount& old_fee, CAmount& new_fee, - CMutableTransaction& mtx) = 0; + CMutableTransaction& mtx, + std::optional reduce_output) = 0; //! Sign bump transaction. virtual bool signBumpTransaction(CMutableTransaction& mtx) = 0; diff --git a/src/qt/walletmodel.cpp b/src/qt/walletmodel.cpp index 0a01c0a45b1..468f2302a2e 100644 --- a/src/qt/walletmodel.cpp +++ b/src/qt/walletmodel.cpp @@ -487,7 +487,7 @@ bool WalletModel::bumpFee(uint256 hash, uint256& new_hash) CAmount old_fee; CAmount new_fee; CMutableTransaction mtx; - if (!m_wallet->createBumpTransaction(hash, coin_control, errors, old_fee, new_fee, mtx)) { + if (!m_wallet->createBumpTransaction(hash, coin_control, errors, old_fee, new_fee, mtx, /*reduce_output=*/std::nullopt)) { QMessageBox::critical(nullptr, tr("Fee bump error"), tr("Increasing transaction fee failed") + "
(" + (errors.size() ? QString::fromStdString(errors[0].translated) : "") +")"); return false; diff --git a/src/wallet/interfaces.cpp b/src/wallet/interfaces.cpp index 21e8a0b3bd2..58b4da39171 100644 --- a/src/wallet/interfaces.cpp +++ b/src/wallet/interfaces.cpp @@ -314,10 +314,11 @@ class WalletImpl : public Wallet std::vector& errors, CAmount& old_fee, CAmount& new_fee, - CMutableTransaction& mtx) override + CMutableTransaction& mtx, + std::optional reduce_output) override { std::vector outputs; // just an empty list of new recipients for now - return feebumper::CreateRateBumpTransaction(*m_wallet.get(), txid, coin_control, errors, old_fee, new_fee, mtx, /* require_mine= */ true, outputs) == feebumper::Result::OK; + return feebumper::CreateRateBumpTransaction(*m_wallet.get(), txid, coin_control, errors, old_fee, new_fee, mtx, /* require_mine= */ true, outputs, reduce_output) == feebumper::Result::OK; } bool signBumpTransaction(CMutableTransaction& mtx) override { return feebumper::SignTransaction(*m_wallet.get(), mtx); } bool commitBumpTransaction(const uint256& txid,