-
Notifications
You must be signed in to change notification settings - Fork 1.2k
backport: bitcoin#25122, #25504, #25647, #25768, #25924, #25933, #25990, #26021, #26037, #26091, #26203, #26205, bitcoin-core/gui#598 #7550
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
base: develop
Are you sure you want to change the base?
Changes from all commits
3060fc0
1723bc7
1403845
b1ae861
610072a
fadd9ae
6b498d2
8295b41
6200cc9
5895778
9f1f4ac
553fd18
c2bd65e
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,7 @@ | ||
|
|
||
| Wallet | ||
| ------ | ||
|
|
||
| - RPC `getreceivedbylabel` now returns an error, "Label not found | ||
| in wallet" (-4), if the label is not in the address book. (dash#7550) | ||
|
|
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,6 @@ | ||
| Updated RPCs | ||
| ------------ | ||
|
|
||
| - The `listsinceblock`, `listtransactions` and `gettransaction` output now contain a new | ||
| `parent_descs` field for every "receive" entry. | ||
| - A new optional `include_change` parameter was added to the `listsinceblock` command. | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -163,8 +163,6 @@ OverviewPage::OverviewPage(QWidget* parent) : | |
|
|
||
| GUIUtil::updateFonts(); | ||
|
|
||
| m_balances.balance = -1; | ||
|
|
||
| // Recent transactions | ||
| ui->listTransactions->setItemDelegate(txdelegate); | ||
| // Note: minimum height of listTransactions will be set later in updateAdvancedCJUI() to reflect actual settings | ||
|
|
@@ -202,8 +200,9 @@ void OverviewPage::setPrivacy(bool privacy) | |
| { | ||
| m_privacy = privacy; | ||
| clientModel->getOptionsModel()->setOption(OptionsModel::OptionID::MaskValues, privacy); | ||
| if (m_balances.balance != -1) { | ||
| setBalance(m_balances); | ||
| const auto& balances = walletModel->getCachedBalance(); | ||
| if (balances.balance != -1) { | ||
| setBalance(balances); | ||
| coinJoinStatus(true); | ||
| } | ||
|
|
||
|
|
@@ -226,7 +225,6 @@ OverviewPage::~OverviewPage() | |
| void OverviewPage::setBalance(const interfaces::WalletBalances& balances) | ||
| { | ||
| BitcoinUnit unit = walletModel->getOptionsModel()->getDisplayUnit(); | ||
| m_balances = balances; | ||
| if (walletModel->wallet().isLegacy()) { | ||
| if (walletModel->wallet().privateKeysDisabled()) { | ||
| ui->labelBalance->setText(BitcoinUnits::floorHtmlWithPrivacy(unit, balances.watch_only_balance, BitcoinUnits::SeparatorStyle::ALWAYS, m_privacy)); | ||
|
|
@@ -312,12 +310,11 @@ void OverviewPage::setWalletModel(WalletModel *model) | |
| // update the display unit, to not use the default ("DASH") | ||
| updateDisplayUnit(); | ||
| // Keep up to date with wallet | ||
| interfaces::Wallet& wallet = model->wallet(); | ||
| interfaces::WalletBalances balances = wallet.getBalances(); | ||
| setBalance(balances); | ||
| setBalance(model->getCachedBalance()); | ||
| connect(model, &WalletModel::balanceChanged, this, &OverviewPage::setBalance); | ||
|
|
||
| updateWatchOnlyLabels((wallet.haveWatchOnly() && !model->wallet().privateKeysDisabled()) || gArgs.GetBoolArg("-debug-ui", false)); | ||
| interfaces::Wallet& wallet = model->wallet(); | ||
| updateWatchOnlyLabels((wallet.haveWatchOnly() && !wallet.privateKeysDisabled()) || gArgs.GetBoolArg("-debug-ui", false)); | ||
| connect(model, &WalletModel::notifyWatchonlyChanged, [this](bool showWatchOnly) { | ||
| updateWatchOnlyLabels(showWatchOnly && !walletModel->wallet().privateKeysDisabled()); | ||
| }); | ||
|
|
@@ -348,11 +345,11 @@ void OverviewPage::setWalletModel(WalletModel *model) | |
|
|
||
| void OverviewPage::updateDisplayUnit() | ||
| { | ||
| if(walletModel && walletModel->getOptionsModel()) | ||
| { | ||
| if (walletModel && walletModel->getOptionsModel()) { | ||
| m_display_bitcoin_unit = walletModel->getOptionsModel()->getDisplayUnit(); | ||
| if (m_balances.balance != -1) { | ||
| setBalance(m_balances); | ||
| const auto& balances = walletModel->getCachedBalance(); | ||
| if (balances.balance != -1) { | ||
| setBalance(balances); | ||
| } | ||
|
|
||
| // Update txdelegate->unit with the current unit | ||
|
|
@@ -404,7 +401,8 @@ void OverviewPage::updateCoinJoinProgress() | |
| QString strAmountAndRounds; | ||
| QString strCoinJoinAmount = BitcoinUnits::formatHtmlWithUnit(m_display_bitcoin_unit, clientModel->coinJoinOptions().getAmount() * COIN, false, BitcoinUnits::SeparatorStyle::ALWAYS); | ||
|
|
||
| if(m_balances.balance == 0) | ||
| const auto& balances = walletModel->getCachedBalance(); | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
When only AGENTS.md reference: AGENTS.md:L15-L17 Useful? React with 👍 / 👎. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Confirmed as a Dash-specific regression. Before this backport, the advanced CoinJoin path fetched wallet().getBalances() directly. The new cached path depends on WalletBalances::balanceChanged(), which does not compare denominated_trusted or denominated_untrusted_pending, so those fields can remain stale when they change independently. This needs a Dash adaptation before merge. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🔴 Blocking: Refresh CoinJoin progress from uncached denominated balances The backport replaces the advanced CoinJoin view's direct source: ['codex'] |
||
| if(balances.balance == 0) | ||
| { | ||
| ui->coinJoinProgress->setValue(0); | ||
| ui->coinJoinProgress->setToolTip(tr("No inputs detected")); | ||
|
|
@@ -420,7 +418,7 @@ void OverviewPage::updateCoinJoinProgress() | |
|
|
||
| CAmount nAnonymizableBalance = walletModel->wallet().getAnonymizableBalance(false, false); | ||
|
|
||
| CAmount nMaxToAnonymize = nAnonymizableBalance + m_balances.anonymized_balance; | ||
| CAmount nMaxToAnonymize = nAnonymizableBalance + balances.anonymized_balance; | ||
|
|
||
| // If it's more than the anon threshold, limit to that. | ||
| if (nMaxToAnonymize > clientModel->coinJoinOptions().getAmount() * COIN) nMaxToAnonymize = clientModel->coinJoinOptions().getAmount() * COIN; | ||
|
|
@@ -451,7 +449,6 @@ void OverviewPage::updateCoinJoinProgress() | |
|
|
||
| if (!fShowAdvancedCJUI) return; | ||
|
|
||
| const interfaces::WalletBalances balances = walletModel->wallet().getBalances(); | ||
| CAmount nDenominatedConfirmedBalance = balances.denominated_trusted; | ||
| CAmount nDenominatedUnconfirmedBalance = balances.denominated_untrusted_pending; | ||
| CAmount nNormalizedAnonymizedBalance; | ||
|
|
@@ -477,7 +474,7 @@ void OverviewPage::updateCoinJoinProgress() | |
| anonNormPart = anonNormPart > 1 ? 1 : anonNormPart; | ||
| anonNormPart *= 100; | ||
|
|
||
| anonFullPart = (float)m_balances.anonymized_balance / nMaxToAnonymize; | ||
| anonFullPart = (float)balances.anonymized_balance / nMaxToAnonymize; | ||
| anonFullPart = anonFullPart > 1 ? 1 : anonFullPart; | ||
| anonFullPart *= 100; | ||
|
|
||
|
|
@@ -692,7 +689,7 @@ void OverviewPage::coinJoinStatus(bool fForce) | |
| setWidgetsVisible(true); | ||
| } | ||
|
|
||
| void OverviewPage::toggleCoinJoin(){ | ||
| void OverviewPage::toggleCoinJoin() { | ||
| QSettings settings; | ||
| // Popup some information on first mixing | ||
| QString hasMixed = settings.value("hasMixed").toString(); | ||
|
|
@@ -707,9 +704,10 @@ void OverviewPage::toggleCoinJoin(){ | |
| bool mixing{false}; | ||
| walletModel->withCoinJoin([&](auto& client) { mixing = client.isMixing(); }); | ||
| if (!mixing) { | ||
| const auto& balances = walletModel->getCachedBalance(); | ||
| auto& options = walletModel->node().coinJoinOptions(); | ||
| const CAmount nMinAmount = options.getSmallestDenomination() + options.getMaxCollateralAmount(); | ||
| if(m_balances.balance < nMinAmount) { | ||
| if(balances.balance < nMinAmount) { | ||
| QString strMinAmount(BitcoinUnits::formatWithUnit(m_display_bitcoin_unit, nMinAmount)); | ||
| QMessageBox::warning(this, strCoinJoinName, | ||
| tr("%1 requires at least %2 to use.").arg(strCoinJoinName).arg(strMinAmount), | ||
|
|
||
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -73,6 +73,10 @@ WalletModel::~WalletModel() | |||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||
| void WalletModel::startPollBalance() | ||||||||||||||||||||||||||||||||||||||||
| { | ||||||||||||||||||||||||||||||||||||||||
| // Update the cached balance right away, so every view can make use of it, | ||||||||||||||||||||||||||||||||||||||||
| // so them don't need to waste resources recalculating it. | ||||||||||||||||||||||||||||||||||||||||
| pollBalanceChanged(); | ||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||
| // This timer will be fired repeatedly to update the balance | ||||||||||||||||||||||||||||||||||||||||
| // Since the QTimer::timeout is a private signal, it cannot be used | ||||||||||||||||||||||||||||||||||||||||
| // in the GUIUtil::ExceptionSafeConnect directly. | ||||||||||||||||||||||||||||||||||||||||
|
|
@@ -137,12 +141,17 @@ void WalletModel::pollBalanceChanged() | |||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||
| void WalletModel::checkBalanceChanged(const interfaces::WalletBalances& new_balances) | ||||||||||||||||||||||||||||||||||||||||
| { | ||||||||||||||||||||||||||||||||||||||||
| if(new_balances.balanceChanged(m_cached_balances)) { | ||||||||||||||||||||||||||||||||||||||||
| if (new_balances.balanceChanged(m_cached_balances)) { | ||||||||||||||||||||||||||||||||||||||||
| m_cached_balances = new_balances; | ||||||||||||||||||||||||||||||||||||||||
| Q_EMIT balanceChanged(new_balances); | ||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||
| interfaces::WalletBalances WalletModel::getCachedBalance() const | ||||||||||||||||||||||||||||||||||||||||
| { | ||||||||||||||||||||||||||||||||||||||||
| return m_cached_balances; | ||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||
| void WalletModel::updateTransaction() | ||||||||||||||||||||||||||||||||||||||||
| { | ||||||||||||||||||||||||||||||||||||||||
| // Balance and number of transactions might have changed | ||||||||||||||||||||||||||||||||||||||||
|
|
@@ -258,7 +267,9 @@ WalletModel::SendCoinsReturn WalletModel::prepareTransaction(WalletModelTransact | |||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||
| CAmount nBalance = m_wallet->getAvailableBalance(coinControl); | ||||||||||||||||||||||||||||||||||||||||
| // If no coin was manually selected, use the cached balance | ||||||||||||||||||||||||||||||||||||||||
| // Future: can merge this call with 'createTransaction'. | ||||||||||||||||||||||||||||||||||||||||
| CAmount nBalance = getAvailableBalance(&coinControl); | ||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||
| if(total > nBalance) | ||||||||||||||||||||||||||||||||||||||||
| { | ||||||||||||||||||||||||||||||||||||||||
|
|
@@ -633,3 +644,14 @@ uint256 WalletModel::getLastBlockProcessed() const | |||||||||||||||||||||||||||||||||||||||
| { | ||||||||||||||||||||||||||||||||||||||||
| return m_client_model ? m_client_model->getBestBlockHash() : uint256{}; | ||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||
| CAmount WalletModel::getAvailableBalance(const CCoinControl* control) | ||||||||||||||||||||||||||||||||||||||||
| { | ||||||||||||||||||||||||||||||||||||||||
| if (control && control->HasSelected()) { | ||||||||||||||||||||||||||||||||||||||||
| return wallet().getAvailableBalance(*control); | ||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||
| if (control && control->IsUsingCoinJoin()) { | ||||||||||||||||||||||||||||||||||||||||
| return getCachedBalance().anonymized_balance; | ||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||
| return getCachedBalance().balance; | ||||||||||||||||||||||||||||||||||||||||
|
Comment on lines
+648
to
+656
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🔴 Blocking: Honor watch-only coin control without manual inputs
Suggested change
source: ['codex']
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. that's backported code as it is from mainstream There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The line does match the original gui#598 backport, but upstream later confirmed this exact cached fast path was a bug and fixed it in bitcoin#26699, commit So exactness to gui#598 does not clear this finding—the PR is bringing in gui#598 without its upstream bugfix follow-up. Please backport the relevant bitcoin#26699 commit (or an equivalent |
||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||
|
Comment on lines
+648
to
+657
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🔴 Blocking: Use the CoinJoin balance for unselected CoinJoin controls The CoinJoin send dialog calls
Suggested change
source: ['codex'] There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Resolved in this update — Use the CoinJoin balance for unselected CoinJoin controls no longer present. Auto-resolved by the review system based on the latest commit diff. If you believe this was closed in error, reopen the thread. |
||||||||||||||||||||||||||||||||||||||||
Uh oh!
There was an error while loading. Please reload this page.