Commit Graph

18408 Commits

Author SHA1 Message Date
xdustinface
5020a68f33 qt|interfaces: Avoid redundant status update calls
- 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
2020-10-14 12:49:36 +01:00
xdustinface
cee8c151fa scripted-diff: Merge #12906: Avoid interface keyword to fix windows gitian build
17780d6f35 scripted-diff: Avoid `interface` keyword to fix windows gitian build (Russell Yanofsky)

Pull request description:

  Rename `interface` to `interfaces`

  Build failure reported by ken2812221 in https://github.com/bitcoin/bitcoin/pull/10244#issuecomment-379434756

Tree-SHA512: e02c97c728540f344202c13b036f9f63af23bd25e25ed7a5cfe9e2c2f201a12ff232cc94a93fbe37ef6fb6bf9e036fe62210ba798ecd30de191d09338754a8d0

-BEGIN VERIFY SCRIPT-
git mv src/interface src/interfaces
ren() { git grep -l "$1" | xargs sed -i "s,$1,$2,g"; }
ren interface/            interfaces/
ren interface::           interfaces::
ren BITCOIN_INTERFACE_    BITCOIN_INTERFACES_
ren "namespace interface" "namespace interfaces"
-END VERIFY SCRIPT-
2020-10-14 12:10:12 +01:00
xdustinface
7ab1051bf0 Partially backport bitcoin#11403 2020-10-14 12:10:11 +01:00
xdustinface
79d32b5b9e test: Fix wallet tests 2020-10-14 12:10:11 +01:00
Jonas Schnelli
7c6cecaf29 Merge #18123: gui: Fix race in WalletModel::pollBalanceChanged
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
2020-10-14 12:10:11 +01:00
xdustinface
6088650438 test: Add boost/signals2/connection.hpp to lint-inlcudes.sh 2020-10-14 12:10:11 +01:00
xdustinface
1a5a1ca78a interface/qt: Remove direct src/privatesend calls
Refactored into interface::PrivateSend::Options and
interface::PrivateSend::Client
2020-10-14 12:09:45 +01:00
xdustinface
555a184a6a interface/qt: Remove direct src/masterode calls
Refactored into interface::Node::Masternode
2020-10-05 15:41:38 +02:00
xdustinface
e24b6228ad interface/qt: Remove direct src/llmq calls
Refactored into interface::Node::LLMQ
2020-10-05 15:13:34 +02:00
xdustinface
6c900725c2 interface/qt: Remove direct src/evo calls
Refactored into interface::Node::EVO
2020-10-05 15:13:34 +02:00
xdustinface
3139459c71 qt|privatesend: Remove unused wallet inlcudes 2020-10-05 15:13:34 +02:00
xdustinface
07600d9aa7 qt: Cleanup in OptionsDialog
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.
2020-10-05 15:13:34 +02:00
Russell Yanofsky
ce41506a3e Add developer notes about blocking GUI code 2020-10-05 15:13:34 +02:00
Russell Yanofsky
1133dfc1ce Use WalletBalances struct in Qt
Suggested by John Newbery <john@johnnewbery.com>
https://github.com/bitcoin/bitcoin/pull/10244#discussion_r177504284
2020-10-05 15:13:34 +02:00
Russell Yanofsky
8549622027 Remove direct bitcoin calls from qt/sendcoinsdialog.cpp 2020-10-05 15:13:34 +02:00
Russell Yanofsky
e4e00cbbdd Remove direct bitcoin access from qt/guiutil.cpp 2020-10-05 15:13:34 +02:00
Russell Yanofsky
155324e867 Remove direct bitcoin calls from qt transaction table files 2020-10-05 15:13:34 +02:00
Russell Yanofsky
b2f7e1d1eb Remove direct bitcoin calls from qt/paymentserver.cpp 2020-10-05 15:13:34 +02:00
Russell Yanofsky
50f7d661ab Remove direct bitcoin calls from qt/addresstablemodel.cpp 2020-10-05 15:13:34 +02:00
Russell Yanofsky
7bb2d25c3d Remove direct bitcoin calls from qt/coincontroldialog.cpp 2020-10-05 15:13:34 +02:00
Russell Yanofsky
bda6fc4be9 Remove most direct bitcoin calls from qt/walletmodel.cpp 2020-10-05 15:13:31 +02:00
Russell Yanofsky
6298c97c29 Remove direct bitcoin calls from qt/optionsdialog.cpp 2020-10-05 02:01:17 +02:00
Russell Yanofsky
a19c1f8b88 Remove direct bitcoin calls from qt/rpcconsole.cpp 2020-10-05 02:01:17 +02:00
Russell Yanofsky
80286d777a Remove direct bitcoin calls from qt/bantablemodel.cpp 2020-10-05 02:01:17 +02:00
Russell Yanofsky
59cec79288 Remove direct bitcoin calls from qt/peertablemodel.cpp 2020-10-05 02:01:17 +02:00
Russell Yanofsky
5512eca39c Remove direct bitcoin calls from qt/intro.cpp 2020-10-05 02:01:15 +02:00
Russell Yanofsky
7fe386a00f Remove direct bitcoin calls from qt/clientmodel.cpp 2020-10-03 21:36:31 +02:00
Russell Yanofsky
2856f46424 Remove direct bitcoin calls from qt/splashscreen.cpp 2020-10-03 21:36:31 +02:00
Russell Yanofsky
2fdf3d8c64 Remove direct bitcoin calls from qt/utilitydialog.cpp 2020-10-03 21:36:31 +02:00
Russell Yanofsky
50f1a6205e Remove direct bitcoin calls from qt/bitcoingui.cpp 2020-10-03 21:36:31 +02:00
Russell Yanofsky
f45e095566 Remove direct bitcoin calls from qt/optionsmodel.cpp 2020-10-03 21:36:27 +02:00
Russell Yanofsky
e709f5a45e Remove direct bitcoin calls from qt/bitcoin.cpp 2020-10-03 21:17:37 +02:00
Russell Yanofsky
98473af332 Add src/interface/README.md 2020-10-03 21:17:37 +02:00
UdjinM6
81ce9c451a
qt: More asset cleanup (#3735)
* 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
2020-09-30 16:08:11 +03:00
UdjinM6
1624c681df
Always harden osx binaries when creating detached sigs (#3752)
This is required for macos app notarization https://developer.apple.com/documentation/xcode/notarizing_macos_software_before_distribution
2020-09-30 15:32:24 +03:00
thephez
73d8805dc9
contrib: Added thephez.pgp (#3750) 2020-09-30 15:30:55 +03:00
PastaPastaPasta
7058fd7dfc
test: Optimize feature_block_reward_reallocation.py (#3743)
* 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>
2020-09-30 15:30:20 +03:00
dustinface
24dfb64c9f
qt: Fix font family updates (#3746)
* 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>
2020-09-29 04:09:20 +03:00
UdjinM6
b3d3b48cba
qt: Fix Recent transactions list height (#3744)
* 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
2020-09-29 02:16:03 +03:00
dustinface
4cb2af80b1
qt: Fix font size and scaling issues (#3734)
* 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>
2020-09-29 02:15:20 +03:00
UdjinM6
e117a2fee7
Translations 2020-09 (#3736)
* Update dash_en and dashstrings

* ru

* fi, vi

* 98.94%: ar, de, es, fr, it, ko, nl, pl, th, zh_TW

* >80%: ja, pt, ro, sk, tr, zh_CN

* 100%: pt, tr

* ~98%: zh_CN
2020-09-28 21:53:37 +03:00
UdjinM6
b441e31ecb
Bump few things and update man pages for v0.16 (#3737)
* 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
2020-09-28 19:53:41 +03:00
dustinface
9a9e21c910
qt: Add PrivateSend tab in OptionsDialog, allow to show/hide PS UI (#3717)
* 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>
2020-09-28 10:41:19 +03:00
UdjinM6
578fe89bfc
Do not try to access new tx in WalletModel::prepareTransaction if it wasn't really created (#3733) 2020-09-26 14:11:41 +03:00
UdjinM6
29c7c6af19
Handle situations when we have evodb records but no blocks anymore (#3722)
* 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>
2020-09-25 19:19:58 +03:00
dustinface
b22aa1813c
qt: Finetune OverviewPage (#3715)
* 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#layoutAboutToBeChanged
https://doc.qt.io/qt-5/qabstractitemmodel.html#layoutChanged

Co-authored-by: UdjinM6 <UdjinM6@users.noreply.github.com>
2020-09-25 19:04:53 +03:00
UdjinM6
e552c898b9
Fix mempool sync (#3725)
* 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>
2020-09-24 13:59:09 +03:00
Minh20
465ecee144
docs: Properly alphabetize output of CLI --help option (backport 12331) (#3681)
* Helpmessage outp alphabetized

Properly alphabetize output of CLI

* Helpmessage outp alphabetized

Properly alphabetize output of CLI

* Update src/init.cpp

Co-authored-by: UdjinM6 <UdjinM6@users.noreply.github.com>

* Update src/init.cpp

Co-authored-by: UdjinM6 <UdjinM6@users.noreply.github.com>

* Update src/init.cpp

Co-authored-by: UdjinM6 <UdjinM6@users.noreply.github.com>

* Update src/init.cpp

Co-authored-by: UdjinM6 <UdjinM6@users.noreply.github.com>

* Update src/init.cpp

Co-authored-by: UdjinM6 <UdjinM6@users.noreply.github.com>

* Update src/init.cpp

Co-authored-by: UdjinM6 <UdjinM6@users.noreply.github.com>

* Update src/init.cpp

Co-authored-by: UdjinM6 <UdjinM6@users.noreply.github.com>

* Update src/init.cpp

Co-authored-by: UdjinM6 <UdjinM6@users.noreply.github.com>

* Update src/init.cpp

Co-authored-by: UdjinM6 <UdjinM6@users.noreply.github.com>

* Update src/dash-cli.cpp

Co-authored-by: UdjinM6 <UdjinM6@users.noreply.github.com>

* Update src/init.cpp

Co-authored-by: UdjinM6 <UdjinM6@users.noreply.github.com>

* Update src/dash-cli.cpp

Co-authored-by: UdjinM6 <UdjinM6@users.noreply.github.com>

* Update src/init.cpp

Co-authored-by: UdjinM6 <UdjinM6@users.noreply.github.com>

* Update src/init.cpp

Co-authored-by: UdjinM6 <UdjinM6@users.noreply.github.com>

* Update src/init.cpp

Co-authored-by: UdjinM6 <UdjinM6@users.noreply.github.com>

* Update src/init.cpp

Co-authored-by: UdjinM6 <UdjinM6@users.noreply.github.com>

* Update src/init.cpp

Co-authored-by: UdjinM6 <UdjinM6@users.noreply.github.com>

* Auto stash before merge of "alphabetize" and "origin/alphabetize"

* Revert "Auto stash before merge of "alphabetize" and "origin/alphabetize""

This reverts commit 0edae12358.

* Changes for 769f08f

* changes for bc2ac58

Co-authored-by: UdjinM6 <UdjinM6@users.noreply.github.com>
2020-09-24 13:58:29 +03:00
dustinface
b10dc1f547
qt: Finetune CoinControlDialog + bitcoin#14828 (#3701)
* 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>
2020-09-23 10:31:50 +03:00
thephez
ae40b96ed0
RPC: Update getprivatesendinfo help (#3727) 2020-09-23 09:37:44 +03:00