- Call `statusUpdateNeeded` before `tryGetTxStatus`. This allows to run
the latter only if really required i.e. if `statusUpdateNeeded` returns true.
- Reuse `cachedNumBlocks` from `WalletModel` in `TransactionTablePriv::index()` to _actually_ avoid redundant tx status updates
- Initialize `cachedNumBlocks` and `cachedChainLockHeight` with `-1` to avoid extra `pollBalanceChanged` call
bf36a3ccc212ad4d7c5cb8f26d7a22e279fe3cec gui: Fix race in WalletModel::pollBalanceChanged (Russell Yanofsky)
Pull request description:
Poll function was wrongly setting cached height to the current chain height instead of the chain height at the time of polling.
This bug could cause balances to appear out of date, and was first introduced a0704a8996 (diff-2e3836af182cfb375329c3463ffd91f8L117). Before that commit, there wasn't a problem because cs_main was held during the poll update.
Currently, the problem should be rare. But if 8937d99ce81a27ae5e1012a28323c0e26d89c50b from #17954 were merged, the problem would get worse, because the wrong cachedNumBlocks value would be set if the wallet was polled in the interval between a block being connected and it processing the BlockConnected notification.
MarcoFalke also points out that a0704a8996 could lead to GUI hangs as well, because previously the pollBalanceChanged method, which runs on the GUI thread, would only make a nonblocking TRY_LOCK(cs_main) call, but after could make blocking LOCK(cs_main) calls, potentially locking up the GUI.
Thanks to John Newbery for finding this bug this while reviewing https://github.com/bitcoin/bitcoin/pull/17954.
ACKs for top commit:
Empact:
utACK bf36a3ccc2
jonasschnelli:
utACK bf36a3c
Tree-SHA512: 1f4f229fa70a6d1fcf7be3806dca3252e86bc1755168fb421258389eb95aae67f863cb1216e6dc086b596c33560d1136215a4c87b5ff890abc8baaa3333b47f4
Made node sense to squash it into the related OptionsDialog commit of
the initial PR because this diff uses the wallet interface which gets
introduced one commit after the related commit.
* Drop icon sources (svg) we no longer use
* Rename some icons to better match their content
* Drop chevron/console prompt icon
We do not show it in Dash specific themes and Traditional is just fine with a simple ">" label
* bitcoin -> dash for icons
* Adjust `contrib/debian/copyright`
Dashify it + we no longer use icons mentioned there
* `mogrify src/qt/res/*/*.png`
* `python3 contrib/devtools/optimize-pngs.py`
Total reduction: 68072 bytes
* test: Optimize feature_block_reward_reallocation.py
Signed-off-by: pasta <pasta@dashboost.org>
* use submitblock instead of p2p.send_blocks_and_test in one more place
* drop empty line
* make sure all nodes are synced after reallocation is done
Co-authored-by: UdjinM6 <UdjinM6@users.noreply.github.com>
* qt: Update the application font if the font family gets changed
* qt: Make sure recent transactions have the correct font family
Introduced because QListView is ignored in GUIUtil::updateFonts, so its base font family doesn't change, hence the recent transactions don't adjust because the painter's font doesn't change.
* Store initial font size
Co-authored-by: UdjinM6 <UdjinM6@users.noreply.github.com>
* qt: Bring back setMinimumHeight for recent tx list
This partially reverts a3604f5c7c
Turns out that we still need this at least on Windows (not sure why but tx list looks clipped there atm)
* Reduce number of items in recent tx list by 1 (for PS enabled cases only)
Most users will never see immature funds and the list is going to be too long for them most of the time
* qt: Make sure font size in MasternodeList gets scaled as expected
* qt: Make sure font size in ShutdownWindow gets scaled as expected
* qt: Drop obsolete application font updates
* qt: Scale QMenu and QMessageBox globally
To make sure non-custom context menus + QMessageBox instances createy by
static calls like QMessageBox::critical are scaled also.
* qt: Avoid redundant scaling for tooltips and menus
* qt: Only update widget's font if required
* qt: Merge GUIUtil::mapFontSizeUpdates into GUIUtil::mapNormalFontUpdates
* qt: Remove obsolete setFixedPitchFont call
* qt: Use setFixedPitchFont in SendCoinsEntry
* qt: Scale font size in increments of 0.25
* qt: Properly scale network traffic stats depending on font metrics
* qt: Update min/max width of OptionsDialog depending on buttons width
* qt: Emit a signal whenever any attribute of AppearanceWidget changed
* qt: Update OptionsDialog width if the appearance changed
* qt: Calculate the initial wide right after the window showed up
Make sure the visibility state of the widgets is correct before width calculations.
* qt: Call parent class showEvent + override it explicit
Co-authored-by: UdjinM6 <UdjinM6@users.noreply.github.com>
* qt: Let OptionsDialog emit a signal if appearance gets changed
* qt: Resize main toolbar depending on visible buttons / font attributes
* qt: Reset max width after it has been set to still allow window resizing
* qt: Properly update the weight of widgets with default font attributes
* qt: Handle updates to the font attributes
* qt: Use resize() instead of setMaximumWidth()
Co-authored-by: UdjinM6 <UdjinM6@users.noreply.github.com>
* qt: Call GUIUtil::updateFonts in ModalOverlay constructor
* qt: Make sure default fonts are stored properly for the related widget
* qt: Ignore some low level classes in GUIUtil::updateFont
* rpc: Remove obsolete `.arg()` call
* qt: Drop fixedPitchFont
* qt: Avoid redundant font updates. Let GUIUtil::updateFont handle them
* qt: Scale recent transactions on OverviewPage
They were scaled by font inheritance before
* qt: Ignore QListView in GUIUtil::updateFonts
Co-authored-by: UdjinM6 <UdjinM6@users.noreply.github.com>
* Update nMinimumChainWork and defaultAssumeValid
* Update chainTxData
* Bump BLOCK_CHAIN_SIZE
It's 21Gb on my local machine atm, bumping to 25Gb to give it some space
* `gen-manpages.sh`
* bupm BLOCK_CHAIN_SIZE 25->30
* qt: Add PrivateSend tab in OptionsDialog, allow to show/hide PS UI
* qt: Decrease height of OptionsDialog
* Apply suggestions from code review
Co-authored-by: UdjinM6 <UdjinM6@users.noreply.github.com>
* qt: Remove obsolete visibility adjustments
Not longer needed since the page is just not reachable if the button is
hidden.
* qt: Make sure PrivateSend related parts are always initialized properly
Not only if its enabled on startup..
* qt: Make updatePrivateSendVisibility a slot to fix the signal connection
* qt: Fix UI updates on OverviewPage if PrivateSend enabled gets toggled
Other way of connecting the slot with true as parameter didn't work..
* qt: Only update and emit the signal for advanced PS UI if required
* qt: Update fPrivateSendEnabled in OptionsModel instead of OptionsDialog
* qt: Recover the PrivateSend enabled state if OptionsDialog gets rejected
* qt: Enable PrivateSend UI by default
* qt: Add some brackets
* qt: Add a comment
* qt: Add a linebreak to the "Enable PrivateSend features" tooltip
* qt: Remove obsolete comment
Co-authored-by: PastaPastaPasta <6443210+PastaPastaPasta@users.noreply.github.com>
* qt: Move comment
* qt: Properly reset the previous PS state if OptionsDialog gets rejected
Handle all reject reasons not only the cancle button.
Co-authored-by: UdjinM6 <UdjinM6@users.noreply.github.com>
Co-authored-by: PastaPastaPasta <6443210+PastaPastaPasta@users.noreply.github.com>
* Handle situations when we have evodb records but no blocks anymore
* Use IsEmpty
* Apply suggestions from code review
Co-authored-by: dustinface <35775977+xdustinface@users.noreply.github.com>
Co-authored-by: dustinface <35775977+xdustinface@users.noreply.github.com>
* qt: Adjust "Recent Transactions" in Overview tab
Make sure they follow the same format as the transactions in
TransactionsView.
- Removed the transaction type representing arrows
- Apply the same coloring like like in the transaction tab for
the different transaction types (orange = internal, red = outgoing,
green = incoming)
* qt: Cleanup layout of OverviewPage in css
* qt: Add three spacer (left, middle, right) and adjust layout stretch.
This allows to have the elements on the screen aligned symetrically
around the center independent from the window size/resizing.
* qt: Inrease date/amount size for "Recent Transactions" in Overview tab
* qt: Inrease number of "Recent Transactions" displayed in Overview tab
Just to fill the empty space
* qt: Make sure PS elements show as expected and adjust number of recent transactions based on PS
* qt: Adjust transaction entry generation
Co-Authored-By: UdjinM6 <UdjinM6@users.noreply.github.com>
* qt: Adjust warning message box
Co-Authored-By: UdjinM6 <UdjinM6@users.noreply.github.com>
* Move tx list style to css
* Fix tx list style for the traditional theme
* Drop (no longer needed?) min height offset in SetupTransactionList
Can't reproduce the tx list scrolling issue anymore
* Avoid recreating transaction filter from scratch every time SetupTransactionList is called
We call SetupTransactionList every second now (from privateSendStatus()) and this makes GUI unresponsive for huge wallets (I have ~400k txes in my testnet wallet) because of filter recreation/sorting. There is no need to go through all setup steps really, simply updating the limit works just fine and fixes the issue.
* qt: Fix an `if` statement
* qt: Just some refactoring
* fix code style
* bail out if `filter->rowCount() == nNumItems`
* qt: Make sure number of transactions is always correct
* Drop spacer to let recent tx list occupy max height available
* TransactionFilterProxy::setLimit should emit signals to let coresponding layouts update themselves
https://doc.qt.io/qt-5/qabstractitemmodel.html#layoutAboutToBeChangedhttps://doc.qt.io/qt-5/qabstractitemmodel.html#layoutChanged
Co-authored-by: UdjinM6 <UdjinM6@users.noreply.github.com>
* masternode: Fix mempool sync
Make sure the mempool sync requests only happen after the blockchain
sync is done.
* Refactor
Loop only if `-syncmempool`=true, make `if` a bit more readable
Co-authored-by: xdustinface <xdustinfacex@gmail.com>
* qt: Add min-height for CoinControlTreeWidget#treeWidget::item
The rows resize without it if they get locked and the lock icon appears
besides the checkbox. Looks weird.. and especially if you press the lock
all button its just not nice.
* qt: Set background transparency for CoinControl item::hover
* Merge #14828: qt: Remove hidden columns in coin control dialog
1c28feb7d qt: Remove hidden columns in coin control dialog (João Barbosa)
Pull request description:
Instead of having hidden columns, store the data in specific roles.
Overlaps with #14817, fixes#11811.
Tree-SHA512: e86e9ca426b9146ac28997ca1920dbae6cc4e2e494ff94fe131d605cd6c013183fc5de10036c886a4d6dcae497ac4067de3791be0ef9c88f7ce9f57f7bd97422
* qt: Add border-bottom for tree items in CoinControl
* qt: Stretch address column in CoinControlDialog
* Adjust column width for a couple of columns
* qt: Hide PrivateSend rounds column for normal Send tab's CoinControl
* qt: Hide unrelated coins in CoinControl based on active mode. Still allow to show them.
* qt: Hide empty top level items in CoinControlDialog's tree mode
* qt: Hide tree/list radio buttons and default to list for PrivateSend
* qt: Hide address/label column in CoinControl for PrivateSend
* qt: Remove obsolete empty columns
* qt: Rename column "PS Rounds" to "Mixing Rounds"
* qt: Move border-bottom in already existing css selector
* Reveal all PS related coins in coincontrol while in PS mode, not only ones with rounds>=1
Also tweak button text
* qt: Only moving a statement a bit
* qt: Hide the "hideButton" in CoinControlDialog if PrivatSend is disabled
And make it default to show all coins in that case..
Co-authored-by: Jonas Schnelli <dev@jonasschnelli.ch>
Co-authored-by: UdjinM6 <UdjinM6@users.noreply.github.com>