Based on https://github.com/bitcoin/bitcoin/pull/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.
Based on https://github.com/bitcoin/bitcoin/pull/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.
The following sections might be updated with supplementary metadata relevant to reviewers and maintainers.
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.
No conflicts as of last run.
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:
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?
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 -
I could be wrong, though.
41+ address_info = QString::fromStdString(label) + QString(" (") + QString::fromStdString(address) + QString(")");
42+ } else {
43+ address_info = QString::fromStdString(address);
44+ }
45+ }
46+ QString output_info = QString::number(i) + QString(": ") + BitcoinUnits::formatWithUnit(model->getOptionsModel()->getDisplayUnit(), txout.nValue) + tr(" to ") + address_info;
QString::arg
. Also it will fix the lint-qt-translation.py
warning.
The first commit e1ea0ba0f2aa9b36df6b74b664087b236f174990 fails to compile:
0 CXX qt/libbitcoinqt_a-walletmodel.o
1qt/walletmodel.cpp: In member function ‘bool WalletModel::bumpFee(uint256, uint256&)’:
2qt/walletmodel.cpp:486:41: error: no matching function for call to ‘interfaces::Wallet::createBumpTransaction(uint256&, wallet::CCoinControl&, std::vector<bilingual_str>&, CAmount&, CAmount&, CMutableTransaction&)’
3 486 | if (!m_wallet->createBumpTransaction(hash, coin_control, errors, old_fee, new_fee, mtx)) {
4 | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
5In file included from ./qt/walletmodel.h:16,
6 from qt/walletmodel.cpp:9:
7./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>)’
8 166 | virtual bool createBumpTransaction(const uint256& txid,
9 | ^~~~~~~~~~~~~~~~~~~~~
10./interfaces/wallet.h:166:18: note: candidate expects 7 arguments, 6 provided
11make: *** [Makefile:13550: qt/libbitcoinqt_a-walletmodel.o] Error 1
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.
test_bitcoin-qt
fails in the CI: https://github.com/bitcoin-core/gui/actions/runs/11186485220.