Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dialog for allowing the user to choose the change output when bumping a tx #700

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

achow101
Copy link
Member

Based on bitcoin/bitcoin#26467

Implements a GUI dialog for allowing the user to choose the output to reduce when bumping a transaction. This adds the functionality that was added to the RPC.

@DrahtBot
Copy link
Contributor

DrahtBot commented Jan 23, 2023

The following sections might be updated with supplementary metadata relevant to reviewers and maintainers.

Reviews

See the guideline for information on the review process.

Type Reviewers
Concept ACK luke-jr
Approach ACK john-moffett

If your review is incorrectly listed, please react with 👎 to this comment and the bot will ignore it on the next update.

Conflicts

No conflicts as of last run.

@Sjors
Copy link
Member

Sjors commented Jan 24, 2023

Can you add a screenshot to the PR description (and one for the single-output case)?

Copy link
Contributor

@john-moffett john-moffett left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approach ACK

I think I'd prefer if the user had some more information about the outputs in the dialog. Maybe something like this, but worded better:

image

Maybe the actual change address isn't even needed, or could be revealed in a tooltip.

Also, if there's a single change output with sufficient funds for feebumping, then selecting "none" has basically no effect compared to selecting that output, as the wallet will always(?) deduct from that existing change output. Maybe this common case can be simplified by removing the "None" option?

@Sjors
Copy link
Member

Sjors commented Jan 24, 2023

Can we be a bit more bold and just assume that a change address is change, and not show the dialog in that case? Ideally we don't show such a dialog more often than necessary.

@john-moffett
Copy link
Contributor

That would prevent the case where you wanted to deduct the extra fee from the recipient, such as when you initially selected "Subtract fee from amount".

Ideally, you'd only show the dialog if that were selected previously, but I don't think it's persisted anywhere. Eg -

bool fSubtractFeeFromAmount; // memory only

I could be wrong, though.

@hebasto hebasto changed the title qt: Dialog for allowing the user to choose the change output when bumping a tx Dialog for allowing the user to choose the change output when bumping a tx Feb 2, 2023
@achow101 achow101 force-pushed the bumpfee-choose-reduce-output branch from bf222ab to 6547892 Compare May 19, 2023 17:26
@luke-jr
Copy link
Member

luke-jr commented Jun 23, 2023

Concept ACK. I'd just show "Change" for the change, though. End users shouldn't need to know about change addresses.

@achow101 achow101 marked this pull request as ready for review January 8, 2024 16:12
@achow101 achow101 force-pushed the bumpfee-choose-reduce-output branch from b3653bc to c697167 Compare January 8, 2024 16:13
Copy link
Member

@hebasto hebasto left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The first commit e1ea0ba fails to compile:

  CXX      qt/libbitcoinqt_a-walletmodel.o
qt/walletmodel.cpp: In member function ‘bool WalletModel::bumpFee(uint256, uint256&)’:
qt/walletmodel.cpp:486:41: error: no matching function for call to ‘interfaces::Wallet::createBumpTransaction(uint256&, wallet::CCoinControl&, std::vector<bilingual_str>&, CAmount&, CAmount&, CMutableTransaction&)’
  486 |     if (!m_wallet->createBumpTransaction(hash, coin_control, errors, old_fee, new_fee, mtx)) {
      |          ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from ./qt/walletmodel.h:16,
                 from qt/walletmodel.cpp:9:
./interfaces/wallet.h:166:18: note: candidate: ‘virtual bool interfaces::Wallet::createBumpTransaction(const uint256&, const wallet::CCoinControl&, std::vector<bilingual_str>&, CAmount&, CAmount&, CMutableTransaction&, std::optional<unsigned int>)’
  166 |     virtual bool createBumpTransaction(const uint256& txid,
      |                  ^~~~~~~~~~~~~~~~~~~~~
./interfaces/wallet.h:166:18: note:   candidate expects 7 arguments, 6 provided
make: *** [Makefile:13550: qt/libbitcoinqt_a-walletmodel.o] Error 1

src/qt/bumpfeechoosechangedialog.cpp Outdated Show resolved Hide resolved
In order to correctly choose the change output when doing fee bumping in
the GUI, we need to ask the user which output is change. We can make a
guess using our ScriptIsChange heuristic, however the user may have
chosen to have a custom change address or have otherwise labeled their
change address which makes our change detection fail. By asking the user
when fee bumping, we can avoid adding additional change outputs that are
unnecessary.
@achow101 achow101 force-pushed the bumpfee-choose-reduce-output branch from c697167 to 674187c Compare October 4, 2024 20:24
@achow101
Copy link
Member Author

achow101 commented Oct 4, 2024

Rebased and fixed the build issue in the first commit.

@hebasto
Copy link
Member

hebasto commented Oct 29, 2024

test_bitcoin-qt fails in the CI: https://github.com/bitcoin-core/gui/actions/runs/11186485220.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Feature UX All about "how to get things done"
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants