aboutsummaryrefslogtreecommitdiff
path: root/src/qt/bitcoin.cpp
AgeCommit message (Collapse)Author
2020-04-15gui: use PACKAGE_NAME in exception messagefanquake
2020-04-10Merge #17905: gui: Avoid redundant tx status updatesMarcoFalke
96cb597325f64cadb3cf43e2cdb3d7c1e2e49891 gui: Avoid redundant tx status updates (Russell Yanofsky) Pull request description: This PR is part of the [process separation project](https://github.com/bitcoin/bitcoin/projects/10). In `TransactionTablePriv::index`, avoid calling `interfaces::Wallet::tryGetTxStatus` if the status is up to date as of the most recent `NotifyBlockTip` notification. Store height from the most recent notification in a new `ClientModel::cachedNumBlocks` variable in order to check this. This avoids floods of IPC traffic from `tryGetTxStatus` with #10102 when there are a lot of transactions. It might also make the GUI a little more efficient even when there is no IPC. ACKs for top commit: promag: Code review ACK 96cb597325f64cadb3cf43e2cdb3d7c1e2e49891. hebasto: ACK 96cb597325f64cadb3cf43e2cdb3d7c1e2e49891 Tree-SHA512: fce597bf52a813ad4923110d0a39229ea09e1631e0d580ea18cffb09e58cdbb4b111a40a9a9270ff16d8163cd47b0bd9f1fe7e3a6c7ebb19198f049f8dd1aa46
2020-01-19Revert "refactor: Simplify connection syntax"Hennadii Stepanov
This reverts commit 1a53b0da60097cd7fd423c519f01ceca0fd0aa14.
2020-01-16refactor: Simplify connection syntaxHennadii Stepanov
2020-01-15scripted-diff: Bump copyright of files changed in 2020MarcoFalke
-BEGIN VERIFY SCRIPT- ./contrib/devtools/copyright_header.py update ./ -END VERIFY SCRIPT-
2020-01-09gui: Avoid redundant tx status updatesRussell Yanofsky
In TransactionTablePriv::index, avoid calling interfaces::Wallet::tryGetTxStatus if the status is up to date as of the most recent NotifyBlockTip notification. Store height from the most recent notification in a new ClientModel::cachedNumBlocks variable in order to check this. This avoids floods of IPC traffic from tryGetTxStatus with #10102 when there are a lot of transactions. It might also make the GUI a little more efficient even when there is no IPC.
2020-01-08Merge #17696: qt: Force set nPruneSize in QSettings after the intro dialogfanquake
af112ab62895b145660f4cd7ff842e9cfea2a530 qt: Rename SetPrune() to InitializePruneSetting() (Hennadii Stepanov) b0bfbe50282877a1eee87118902901a280d6656d refactor: Drop `bool force' parameter (Hennadii Stepanov) 68c9bbe9bc91f882404556998666b1b5acea60e4 qt: Force set nPruneSize in QSettings after intro (Hennadii Stepanov) a82bd8fa5708c16d1db3edc4e82d70788eb5af19 util: Replace magics with DEFAULT_PRUNE_TARGET_GB (Hennadii Stepanov) Pull request description: On master (5622d8f3156a293e61d0964c33d4b21d8c9fd5e0), having `QSettings` set already ``` $ grep nPruneSize ~/.config/Bitcoin/Bitcoin-Qt-testnet.conf nPruneSize=6 ``` enabling prune option in the intro dialog ``` $ ./src/qt/bitcoin-qt -choosedatadir -testnet ``` ![DeepinScreenshot_select-area_20191208120425](https://user-images.githubusercontent.com/32963518/70388183-eed68580-19b6-11ea-9aa1-f9ad9aaa68a6.png) has no effect: ``` $ grep Prune ~/.bitcoin/testnet3/debug.log 2019-12-08T10:04:41Z Prune configured to target 5722 MiB on disk for block and undo files. ``` --- With this PR: ``` $ grep Prune ~/.bitcoin/testnet3/debug.log 2019-12-08T10:20:35Z Prune configured to target 1907 MiB on disk for block and undo files. ``` This PR has been split of #17453 (the first two commits) as it fixes an orthogonal bug. Refs: - https://github.com/bitcoin/bitcoin/pull/17453#discussion_r345424240 - https://github.com/bitcoin/bitcoin/pull/17453#discussion_r350960201 ACKs for top commit: Sjors: Code review re-ACK af112ab62895b145660f4cd7ff842e9cfea2a530 ryanofsky: Code review ACK af112ab62895b145660f4cd7ff842e9cfea2a530. Just suggested changes since last review (thanks!) promag: Tested ACK af112ab62895b145660f4cd7ff842e9cfea2a530. Latest suggestions and changes look good to me. Tree-SHA512: 8ddad34b30dcc2cdcad6678ba8a0b36fa176e4e3465862ef6eee9be0f98d8146705138c9c7995dd8c0990af41078ca743fef1a90ed9240081f052f32ddec72b9
2020-01-08qt: Rename SetPrune() to InitializePruneSetting()Hennadii Stepanov
This function now resets the prune size and is only called after the intro sequence.
2020-01-08refactor: Drop `bool force' parameterHennadii Stepanov
2020-01-08qt: Force set nPruneSize in QSettings after introHennadii Stepanov
If QSettings is set already, it is required to force set nPruneSize after the intro dialog.
2020-01-05qt: Add LogQtInfo() functionHennadii Stepanov
2019-12-15[qt] remove unused parameter from getWarnings()John Newbery
2019-11-10refactor: Styling w/ clang-format, comment updateHennadii Stepanov
2019-11-10qt: Fix missing qRegisterMetaType for size_tHennadii Stepanov
It is required in order to use size_t in QueuedConnections.
2019-11-04doc: Fix some misspellingsrandymcmillan
2019-10-24Remove BIP70 Supportfanquake
2019-10-15Remove unused includespracticalswift
2019-10-03Don't rename main thread at process levelWladimir J. van der Laan
Set only the internal name. Fixes #17036 for both `bitcoind` and `bitcoin-qt`.
2019-09-26refactor: Remove Qt function to disable menu icons on macOSEmil Engler
2019-09-12Merge #16714: gui: add prune to intro screen with smart defaultJonas Schnelli
9924bce317b96ab0c57efb99330abd11b6f16b9a [gui] intro: enable pruning by default unless disk is big (Sjors Provoost) c8de347a9d6c88fe67d77aba6fcce1b7fd66791c [gui] intro: add prune preference (Sjors Provoost) 1bbc49d2078ee53488e214d00eb47462687b05c5 [gui] intro: inform caller if intro was shown (Sjors Provoost) 1957103786f97135f35ababc97efa1b481865eb0 [gui] add explicit prune setter (Sjors Provoost) 1bccf6a52d7fc08d8f605cfb2edc3277ec299c72 [node] add forceSetArg to interface (Sjors Provoost) Pull request description: This adds a checkbox to the intro screen to enable pruning from the get go. If the user has plenty of space, it's unchecked by default: <img width="671" alt="big" src="https://user-images.githubusercontent.com/10217/63641289-10339000-c6ac-11e9-98d7-caf64dff0da6.png"> If the user has insufficient space it's checked by default: <img width="897" alt="low" src="https://user-images.githubusercontent.com/10217/63641276-d4002f80-c6ab-11e9-9f5b-a53472f814ff.png"> When the user has barely enough space and is likely to need pruning in the near future, this is shown in yellow and we also check the prune box: <img width="662" alt="medium" src="https://user-images.githubusercontent.com/10217/63641294-1c1f5200-c6ac-11e9-8ecb-6b69e42b1ece.png"> The cut-off for this 10 GB above `m_assumed_blockchain_size` (`=240` in `chainparams.cpp`). If the user launches the first time with `-prune=...` then we disable the check box and display the correct size (rounded to GB): <img width="658" alt="Schermafbeelding 2019-08-24 om 20 23 14" src="https://user-images.githubusercontent.com/10217/63641351-09594d00-c6ad-11e9-94fe-fe5ed562e109.png"> The 2 GB default matches the settings default. The user can't change it in the intro screen, but can change it later. I'm tempted to increase that default to 10 GB, and then have the intro screen reduce it if space is really tight. Tips for testing: * move your existing data dir elsewhere * wipe data dir at every restart (behavior is different if it exists) * launch with `bitcoin-qt -resetguisettings -lang=en` (there's some space issues in different languages) * fake your free space by changing `intro.cpp` line 90: `freeBytesAvailable = 5000000000; // 5 GB` * try both testnet and mainnet, because settings are seperate. In particular note how step 7 in `GuiMain` switches where `QTSettings settings` points to; this had me thoroughly confused on testnet, because I was setting them too early. ACKs for top commit: jonasschnelli: Tested ACK 9924bce317b96ab0c57efb99330abd11b6f16b9a ryanofsky: utACK 9924bce317b96ab0c57efb99330abd11b6f16b9a. The changes are very logical, and implement the feature in a clean that way that doesn't add a lot of complication and shouldn't interfere with future improvements. I looked at Luke's branch too, and I think there's also a lot of great stuff there that seems fully compatible with this change. Tree-SHA512: 9523961451c53aebd347716976bc3a4a398f989dc21e9bbbd357060bd11a8f46c435f068bd421bb31ccb08e55445ef67bc347d8d19a4fb8fde9d6d3f9a3bcbb0
2019-09-06Testchains: Qt: Simplify network/chain stylesJorge Timón
2019-09-06Testchains: Generic selection with -chain=<str> in addition of -testnet and ↵Jorge Timón
-regtest
2019-08-24[gui] intro: add prune preferenceSjors Provoost
Adds a checkbox to the introduction screen letting the user enable pruning from the start. Disable checkbox when launched with -prune
2019-08-24[gui] intro: inform caller if intro was shownSjors Provoost
2019-08-24[gui] add explicit prune setterSjors Provoost
This makes it possible to enable pruning after the OptionsModel has been initialized and reset.
2019-08-19Merge #15864: Fix datadir handlingMarcoFalke
ffea41f5301d5582665cf10ba5c2b9547a1443de Enable all tests in feature_config_args.py (Hennadii Stepanov) 66f5c17f8a3fe06fc65191e379ffc04e43cbbc86 Use CheckDataDirOption() for code uniformity (Hennadii Stepanov) 7e33a18a34b1a9b0f115076c142661d6d30c0585 Fix datadir handling in bitcoin-cli (Hennadii Stepanov) b28dada37465c0a773cf08b0e6766f0081bcb943 Fix datadir handling in bitcoin-qt (Hennadii Stepanov) 50824093bb2d68fe1393dfd636fab5f8795faa5d Fix datadir handling in bitcoind (Hennadii Stepanov) 740d41ce9f7fdf209366e930bd0fdcc6b1bc6b79 Add CheckDataDirOption() function (Hennadii Stepanov) c1f325126cf51d28dce8da74bfdf5cd05ab237ea Return absolute path early in AbsPathForConfigVal (Hennadii Stepanov) Pull request description: Fix #15240, see: https://github.com/bitcoin/bitcoin/issues/15240#issuecomment-487353760 Fix #15745 Fix broken `feature_config_args.py` tests (disabled by MarcoFalke@fabe28a0cdcfa13e0e595a0905e3642a960d3077). All test are enabled now. This PR is alternative to #13621. User's `$HOME` directory is not touched unnecessarily now. ~To make reviewing easier only `bitcoind` code is modified (neither `bitcoin-cli` nor `bitcoin-qt`).~ Refs: - https://github.com/bitcoin/bitcoin/issues/15745#issuecomment-479852569 by **laanwj** - #16220 Top commit has no ACKs. Tree-SHA512: 4a4cda10e0b67c8f374da0c9567003d2b566d948e7f8550fe246868b5794c15010e88ea206009480b9cd2f737f310a15e984f920730448f99a895893bed351df
2019-08-09Give QApplication dummy argumentsAndrew Chow
QApplication takes the command line arguments and parses them itself for some built in command line arguments that it has. We don't want any of those built in arguments, so instead give it dummy arguments.
2019-08-02Merge #16097: Refactor: Add Flags enum to ArgsManager classMarcoFalke
e6f649cb2c07bf55d9214c2876619c56f1d6fe30 test: Make tests arg type specific (Hennadii Stepanov) b70cc5d73357ea11296f3b6bb81193ba1101e73b Revamp option negating policy (Hennadii Stepanov) db08edb3038a085d3dbce7bb4ec3c1d9b9a5b281 Replace IsArgKnown() with FlagsOfKnownArg() (Hennadii Stepanov) dde80c272ae584410532f48d23866d7d8581a1cc Use ArgsManager::NETWORK_ONLY flag (Hennadii Stepanov) 9a12733508e47f558959f1b0ed9937bc3eff8962 Remove unused m_debug_only member from Arg struct (Hennadii Stepanov) fb4b9f9e3b433d8848832e2c2686cf7b1f212a5e scripted-diff: Use ArgsManager::DEBUG_ONLY flag (Hennadii Stepanov) 1b4b9422cad28d1bead24ff5fd472536954cfaf9 scripted-diff: Use Flags enum in AddArg() (Hennadii Stepanov) 265c1b58d89b7b6fb30468ba402d7f75cc59a510 Add Flags enum to ArgsManager (Hennadii Stepanov) e0d187dfeb18b026de22bd7960b2a50c2b958e1a Refactor InterpretNegatedOption() function (Hennadii Stepanov) e0e18a1017fa3dc5d6ebeda6ec35c4263327d17c refactoring: Check IsArgKnown() early (Hennadii Stepanov) Pull request description: This PR adds the `Flags` enum to the `ArgsManager` class. Also the `m_flags` member is added to the `Arg` struct. Flags denote an allowed type of an arg value and special hints. This PR is only a refactoring and does not change behavior. ACKs for top commit: jamesob: ACK https://github.com/bitcoin/bitcoin/pull/16097/commits/e6f649cb2c07bf55d9214c2876619c56f1d6fe30 MarcoFalke: ACK e6f649cb2c07bf55d9214c2876619c56f1d6fe30 thanks for adding types to the command line options Tree-SHA512: b867f8a9cbce2d2473c293d534af662d8cd5be15060ff0682e97af678974bdaac35e8bc6328ccba32f105034bcd38f169b92a6fb67798667891ce14d5d2a2dea
2019-07-29Merge #16436: gui: Do not create payment server if -disablewallet option ↵Wladimir J. van der Laan
provided 4057b7acb7125739537078d026ad96bb21708e3c wallet: Recognize -disablewallet option early (Hennadii Stepanov) Pull request description: This PR makes early check for the `-disablewallet` option. If `-disablewallet=1`, objects `PaymentServer` and `WalletController` are nor created. ACKs for top commit: jonasschnelli: utACK 4057b7acb7125739537078d026ad96bb21708e3c laanwj: ACK 4057b7acb7125739537078d026ad96bb21708e3c Tree-SHA512: 74633cd1eacd0914c73712e6dff190255b5378595cfee7eaeb91e17671fc9120928034739f4ae1c53b86f46c4b400390877241384376b2fc534de326d3ab0944
2019-07-27scripted-diff: Use ArgsManager::DEBUG_ONLY flagHennadii Stepanov
-BEGIN VERIFY SCRIPT- sed -i 's/unsigned int flags, const bool debug_only,/unsigned int flags,/' src/util/system.h src/util/system.cpp sed -i 's/ArgsManager::NONE, debug_only/flags, false/' src/util/system.cpp sed -i 's/arg.second.m_debug_only/(arg.second.m_flags \& ArgsManager::DEBUG_ONLY)/' src/util/system.cpp sed -i 's/ArgsManager::ALLOW_ANY, true, OptionsCategory::/ArgsManager::ALLOW_ANY | ArgsManager::DEBUG_ONLY, OptionsCategory::/' $(git grep --files-with-matches 'AddArg(' src) sed -i 's/ArgsManager::ALLOW_ANY, false, OptionsCategory::/ArgsManager::ALLOW_ANY, OptionsCategory::/' $(git grep --files-with-matches 'AddArg(' src) -END VERIFY SCRIPT-
2019-07-27scripted-diff: Use Flags enum in AddArg()Hennadii Stepanov
-BEGIN VERIFY SCRIPT- sed -i 's/const bool debug_only,/unsigned int flags, &/' src/util/system.h src/util/system.cpp sed -i -E 's/(true|false), OptionsCategory::/ArgsManager::ALLOW_ANY, &/' $(git grep --files-with-matches 'AddArg(' src) -END VERIFY SCRIPT-
2019-07-24Fix datadir handling in bitcoin-qtHennadii Stepanov
This prevents premature tries to access or create the default datadir. This is useful when the -datadir option is specified and the default datadir is unreachable.
2019-07-23Merge #16366: init: Use InitError for all errors in bitcoind/qtMarcoFalke
fa6f402bde146f92ed131e0c9c8e15a55e723307 Call node->initError instead of InitError from GUI code (Russell Yanofsky) fad2502240a1c440ef03ac3f880475702e418275 init: Use InitError for all errors in bitcoind/qt (MarcoFalke) Pull request description: Using the same InitError for startup error in the daemon and the gui makes it possible to run the tests with the gui again: ```sh BITCOIND=bitcoin-qt ./test/functional/test_runner.py feature_includeconf feature_config_args ACKs for top commit: hebasto: ACK fa6f402bde146f92ed131e0c9c8e15a55e723307 ryanofsky: utACK fa6f402bde146f92ed131e0c9c8e15a55e723307. Only changes since last review are removing more includes and adding Node::initError method to avoid accessing node `InitError` function and global variables from GUI code. Tree-SHA512: bd19e08dcea4019dfe40356bc5c63cb583cefed54b6c9dcfb82f1b5b00308d8e2b363549afcaea5e93bf83864dbe0917400c3b70f43a8a5bdff45c9cd34cc294
2019-07-23wallet: Recognize -disablewallet option earlyHennadii Stepanov
2019-07-11Call node->initError instead of InitError from GUI codeRussell Yanofsky
Avoids GUI code calling a node function, and having to live in the same process as g_ui_signals and uiInterface global variables.
2019-07-11init: Use InitError for all errors in bitcoind/qtMarcoFalke
Also, remove unused <boost/thread.hpp> include (and others)
2019-07-09Merge #16348: qt: Assert QMetaObject::invokeMethod resultWladimir J. van der Laan
64fee489448c62319e77941c30152084695b5a5d qt: Assert QMetaObject::invokeMethod result (João Barbosa) f27bd96b5fdc2921d93c44bbf422bff0e979c4de gui: Fix missing qRegisterMetaType(WalletModel*) (João Barbosa) Pull request description: Invalid/wrong dynamic calls aren't verified by the compiler. This PR asserts those dynamic calls. Once we bump Qt to at least 5.10 these can be refactored to use the `invokeMethod` overload that allows connecting to lambdas or member pointers, which are compile checked. For reference, one of the overloaded versions is https://doc.qt.io/qt-5/qmetaobject.html#invokeMethod-5. ACKs for top commit: laanwj: ACK 64fee489448c62319e77941c30152084695b5a5d Tree-SHA512: d332e5d7eb2c7be5d3fe90e2e4ff20a67800b9664f6637c122a23647a964f7915703d3f086e2de440f695cfe14de268ff581d0092b7736e911952a4f4d248e25
2019-07-08gui: Fix missing qRegisterMetaType(WalletModel*)João Barbosa
2019-07-08Merge #16291: gui: Stop translating PACKAGE_NAMEMarcoFalke
fa64b947bb3075ff8737656706b941af691908ab util: No translation of `Bitcoin Core` in the copyright (MarcoFalke) fab85208f678ba1be53bdb73a73ce3c5c937d448 qt: Run «make translate» in ./src/ (MarcoFalke) fabe87d2c923ab3a70b8cde2666a4d1cda8b22fb scripted-diff: Avoid passing PACKAGE_NAME for translation (MarcoFalke) fa5e9f157e568b7fbbea1482b393181f0733f2ba build: Stop translating PACKAGE_NAME (MarcoFalke) Pull request description: Generally the package name is not translated, but the package description is. E.g. `GIMP` or `Firefox` are always called that way regardless of the system language. However, "`Firefox` webbrowser" or "`GIMP` image manipulation program" are translated. ACKs for top commit: hebasto: ACK fa64b947bb3075ff8737656706b941af691908ab, I have not tested the code, but I have reviewed it and it looks OK, I agree it can be merged. Tree-SHA512: 626f811531182d0ba0ef1044930d32726773349bcb49b10261288a86ee6b80a183db30a87d817d5b0d501fad058ac22d6272311716b4f5a154f17c6f391a5a1a
2019-07-07Remove unused guardHennadii Stepanov
It is no longer used since switching to autotools build system.
2019-06-26scripted-diff: Avoid passing PACKAGE_NAME for translationMarcoFalke
-BEGIN VERIFY SCRIPT- sed -i --regexp-extended -e 's/\<\w+(::\w+)?\(PACKAGE_NAME\)/PACKAGE_NAME/g' $(git grep -l --extended-regexp '\<\w+(::\w+)?\(PACKAGE_NAME\)' src) -END VERIFY SCRIPT-
2019-06-24Merge #16254: qt: Set AA_EnableHighDpiScaling attribute earlyMarcoFalke
099e4b9ad3 Set AA_EnableHighDpiScaling attribute early (Hennadii Stepanov) Pull request description: Running `bitcoin-qt` compiled against Qt 5.12.4 causes a warning: ``` hebasto@bionic-qt:~/bitcoin$ src/qt/bitcoin-qt Attribute Qt::AA_EnableHighDpiScaling must be set before QCoreApplication is created. ``` This PR fixes this issue. From Qt docs: - [Qt::AA_EnableHighDpiScaling](https://doc.qt.io/qt-5/qt.html#ApplicationAttribute-enum): > Enables high-DPI scaling in Qt on supported platforms (see also High DPI Displays). _Supported platforms are X11, Windows and Android._ Enabling makes Qt scale the main (device independent) coordinate system according to display scale factors provided by the operating system. This corresponds to setting the `QT_AUTO_SCREEN​_SCALE_FACTOR` environment variable to 1. This attribute must be set before `QGuiApplication` is constructed. This value was added in Qt 5.6. - [QCoreApplication::setAttribute()](https://doc.qt.io/qt-5/qcoreapplication.html#setAttribute) ACKs for commit 099e4b: MarcoFalke: ACK 099e4b9ad3d9967051d5c3d45c6315d1b30fea05 jonasschnelli: utACK 099e4b9ad3d9967051d5c3d45c6315d1b30fea05 fanquake: ACK 099e4b9ad3d9967051d5c3d45c6315d1b30fea05. Did some testing on `Bionic` and `Windows 10` (using VirtualBox). I couldn't see any obvious visual difference, but given Marco's screens above, this change is obviously better. I also checked that there wasn't any sort of regression on macOS. Tree-SHA512: 1965a427ee14ffb3871bac317685032406cf02d1fa2b2dc11c8b643bfe4ba09195674d149d1e41752f14c0d000446b35e142f3ce60d987ba97082fd7ee39a094
2019-06-21Use qInfo() if no error occursHennadii Stepanov
qWarning() is used to report warnings and recoverable errors in your application. qInfo() is used for informational messages (since Qt 5.5).
2019-06-20Set AA_EnableHighDpiScaling attribute earlyHennadii Stepanov
Qt docs: This attribute must be set before QGuiApplication is constructed.
2019-06-02Make reasoning about dependencies easier by not including unused dependenciespracticalswift
2019-04-29threads: introduce util/threadnames, refactor thread namingJames O'Beirne
This work is prerequisite to attaching thread names to log lines and deadlock debug utilities. This code allows setting of an "internal" threadname per thread on platforms where thread_local is available. This commit also moves RenameThread() out of a more general module and adds a numeric suffix to disambiguate between threads with the same name. It explicitly names a few main threads using the new util::ThreadRename().
2019-02-14Bump minimum Qt version to 5.5.1Sjors Provoost
2019-02-04gui: Add OpenWalletActivityJoão Barbosa
2019-02-03gui: Fix m_node.startShutdown() orderJoão Barbosa
This change forwards the shutdown request on the GUI (close the application for instace) to the node as soon as possible. This way the GUI doesn't have to wait for long operations to complete (rescan the wallet for instance), instead those operations detect the shutdown request and abort/interrupt.
2019-02-03gui: Fix WalletController deletionJoão Barbosa
The wallet controller instanced must be deleted after the window instance since it is used there.