aboutsummaryrefslogtreecommitdiff
path: root/src/qt/clientmodel.cpp
AgeCommit message (Collapse)Author
2022-08-29ui: show header pre-synchronization progressPieter Wuille
2022-08-29Make validation interface capable of signalling header presyncPieter Wuille
This makes a number of changes: - Get rid of the verification_progress argument in the node interface NotifyHeaderTip (it was always 0.0). - Instead of passing a CBlockIndex* in the UI interface's NotifyHeaderTip, send separate height, timestamp fields. This is becuase in headers presync, no actual CBlockIndex object is available. - Add a bool presync argument to both of the above, to identify signals pertaining to the first headers sync phase.
2022-04-16qt, doc: Remove unneeded commentsHennadii Stepanov
Function names are self-described.
2022-04-16qt: Revamp ClientModel code to handle {Block|Header}Tip core signalsHennadii Stepanov
No behavior change.
2022-04-16qt: Revamp ClientModel code to handle BannedListChanged core signalHennadii Stepanov
No behavior change.
2022-04-16qt: Revamp ClientModel code to handle AlertChanged core signalHennadii Stepanov
No behavior change.
2022-04-10qt: Revamp ClientModel code to handle NetworkActiveChanged core signalHennadii Stepanov
No behavior change.
2022-04-10qt: Revamp ClientModel code to handle NumConnectionsChanged core signalHennadii Stepanov
No behavior change.
2022-04-10qt: Revamp ClientModel code to handle ShowProgress core signalHennadii Stepanov
No behavior change.
2022-03-01Merge bitcoin/bitcoin#22834: net: respect -onlynet= when making outbound ↵laanwj
connections 0eea83a85ec6b215d44facc2b16ee1b035275a6b scripted-diff: rename `proxyType` to `Proxy` (Vasil Dimov) e53a8505dbb6f9deaae8ac82793a4fb760a1e0a6 net: respect -onlynet= when making outbound connections (Vasil Dimov) Pull request description: Do not make outbound connections to hosts which belong to a network which is restricted by `-onlynet`. This applies to hosts that are automatically chosen to connect to and to anchors. This does not apply to hosts given to `-connect`, `-addnode`, `addnode` RPC, dns seeds, `-seednode`. Fixes https://github.com/bitcoin/bitcoin/issues/13378 Fixes https://github.com/bitcoin/bitcoin/issues/22647 Supersedes https://github.com/bitcoin/bitcoin/pull/22651 ACKs for top commit: naumenkogs: utACK 0eea83a85ec6b215d44facc2b16ee1b035275a6b prayank23: reACK https://github.com/bitcoin/bitcoin/pull/22834/commits/0eea83a85ec6b215d44facc2b16ee1b035275a6b jonatack: ACK 0eea83a85ec6b215d44facc2b16ee1b035275a6b code review, rebased to master, debug built, and did some manual testing with various config options on signet Tree-SHA512: 37d68b449dd6d2715843fc84d85f48fa2508be40ea105a7f4a28443b318d0b6bd39e3b2ca2a6186f2913836adf08d91038a8b142928e1282130f39ac81aa741b
2022-01-12Merge bitcoin-core/gui#517: refactor, qt: Use std::chrono for parameters of ↵Hennadii Stepanov
QTimer methods 51250b0906e56b39488304208ad119c951b4ae7d refactor, qt: Use std::chrono for input_filter_delay constant (Hennadii Stepanov) f3bdc143b67e8a5e763071a0774f6d994ca35c57 refactor, qt: Add SHUTDOWN_POLLING_DELAY constant (Hennadii Stepanov) 0e193deb523a4fa04e0ee69bd66f917895802ac9 refactor, qt: Use std::chrono for non-zero arguments in QTimer methods (Hennadii Stepanov) 6f0da958116ecc0e06332fad2f490e37b6884166 refactor, qt: Use std::chrono in ConfirmMessage parameter (Hennadii Stepanov) 33d520ac538fcd6285fd958578f1bd26295592e4 refactor, qt: Use std::chrono for MODEL_UPDATE_DELAY constant (Hennadii Stepanov) Pull request description: Since Qt 5.8 `QTimer` methods have overloads that accept `std::chrono::milliseconds` arguments: - [`QTimer::singleShot`](https://doc.qt.io/archives/qt-5.9/qtimer.html#singleShot-8) - [`QTimer::start`](https://doc.qt.io/archives/qt-5.9/qtimer.html#start-2) ACKs for top commit: promag: Code review ACK 51250b0906e56b39488304208ad119c951b4ae7d. shaavan: reACK 51250b0906e56b39488304208ad119c951b4ae7d Tree-SHA512: aa843bb2322a84c0c2bb113d3b48d7bf02d7f09a770779dcde312c32887f973ef9445cdef42f39edaa599ff0f3d0457454f6153aa130efadd989e413d39c6062
2022-01-11scripted-diff: Rename functions to drop mention of boostHennadii Stepanov
-BEGIN VERIFY SCRIPT- FILES=$(git ls-files src/qt) sed -i 's/boostPathToQString/PathToQString/g' -- $FILES sed -i 's/qstringToBoostPath/QStringToPath/g' -- $FILES -END VERIFY SCRIPT-
2022-01-09refactor, qt: Use std::chrono for MODEL_UPDATE_DELAY constantHennadii Stepanov
2021-12-30scripted-diff: Bump copyright headersHennadii Stepanov
-BEGIN VERIFY SCRIPT- ./contrib/devtools/copyright_header.py update ./ -END VERIFY SCRIPT- Commits of previous years: * 2020: fa0074e2d82928016a43ca408717154a1c70a4db * 2019: aaaaad6ac95b402fe18d019d67897ced6b316ee0
2021-11-24scripted-diff: rename `proxyType` to `Proxy`Vasil Dimov
-BEGIN VERIFY SCRIPT- sed -i 's/\<proxyType\>/Proxy/g' $(git grep -l proxyType) -END VERIFY SCRIPT-
2021-08-24refactor: replace QDateTime::fromTime_t with QDateTime::fromSecsSinceEpochfanquake
2021-05-24scripted-diff: Replace `GetDataDir()` calls with `gArgs.GetDataDirNet()` callsKiminuo
-BEGIN VERIFY SCRIPT- git ls-files -- 'src' ':(exclude)src/util/system.h' ':(exclude)src/util/system.cpp' | xargs sed -i 's/GetDataDir()/gArgs.GetDataDirNet()/g'; -END VERIFY SCRIPT-
2021-04-28Merge bitcoin-core/gui#18: Add peertablesortproxy moduleHennadii Stepanov
5a4a15d2b4456272fd8aa080195f40a09576ae01 qt, refactor: Drop no longer used PeerTableModel::getRowByNodeId func (Hennadii Stepanov) 9a9f180df0d51396fee2468681df6dd935b0248e qt, refactor: Drop no longer used PeerTableModel::sort function (Hennadii Stepanov) 778a64af209e4fa692a3aca8376ba1bd5e1af881 qt: Use PeerTableSortProxy for sorting peer table (Hennadii Stepanov) df2d165ba9e0acc53f36a326f68f57ad9c297872 qt: Add peertablesortproxy module (Hennadii Stepanov) Pull request description: The "Peers" table in the "Node" window does not hold multiple selection after sorting. This PR introduces a `QSortFilterProxyModel` subclass, that is a standard Qt [practice](https://doc.qt.io/qt-5/model-view-programming.html#custom-sorting-models) for such cases. Now the sorting code is encapsulated into the dedicated Qt class, and we do not need to maintain it. Fixes #283 (additionally). --- On **master** (7ae86b3c6845873ca96650fc69beb4ae5285c801): - rows are sorted by "Ping", and a selection is made ![Screenshot from 2020-11-28 22-53-11](https://user-images.githubusercontent.com/32963518/100525900-96eaed00-31cc-11eb-86e7-72ede3b8b33c.png) - rows are sorted by "NodeId", and the previous selection is _lost_ ![Screenshot from 2020-11-28 22-53-21](https://user-images.githubusercontent.com/32963518/100525904-9c483780-31cc-11eb-957c-06f53d7d31ab.png) With **this PR**: - rows are sorted by "Ping", and a selection is made ![Screenshot from 2020-11-28 22-39-41](https://user-images.githubusercontent.com/32963518/100525776-06aca800-31cc-11eb-8c4e-9c6566fe80fe.png) - rows are sorted by "NodeId", and the row are still selected ![Screenshot from 2020-11-28 22-39-53](https://user-images.githubusercontent.com/32963518/100525791-2348e000-31cc-11eb-8b78-716a5551d7ec.png) ACKs for top commit: jarolrod: re-ACK 5a4a15d2b4456272fd8aa080195f40a09576ae01, tested on macOS 11.2 Qt 5.15.2 after rebase promag: Tested ACK 5a4a15d2b4456272fd8aa080195f40a09576ae01. Tree-SHA512: f81c1385892fbf1a46ffb98b42094ca1cc97da52114bbbc94fedb553899b1f18c26a349e186bba6e27922a89426bd61e8bc88b1f7832512dbe211b5f834e076e
2021-04-18Change GetBlocksDir() to ArgsManager.GetBlocksDirPath().Kiminuo
2021-03-07qt: Use PeerTableSortProxy for sorting peer tableHennadii Stepanov
2021-03-04net: Replace enum CConnMan::NumConnections with enum class ConnectionDirectionLuke Dashjr
2021-01-13Add include for std::bind.sinetek
2020-08-13qt: Name ClientModel timer QThreadHennadii Stepanov
2020-06-10Make GetWarnings() return bilingual_strHennadii Stepanov
2020-06-01qt: lock cs_main, m_cached_tip_mutex in that orderVasil Dimov
Always lock the mutexes `cs_main` and `m_cached_tip_mutex` in the same order: `cs_main`, `m_cached_tip_mutex`. Otherwise we may end up in a deadlock. `ClientModel::m_cached_tip_blocks` is protected by `ClientModel::m_cached_tip_mutex`. There are two access paths that lock the two mutexes in opposite order: ``` validation.cpp:2868 CChainState::ActivateBestChain(): lock cs_main validation.cpp:2916 CChainState::ActivateBestChain(): call uiInterface.NotifyBlockTip() ui_interface.cpp:52 CClientUIInterface::NotifyBlockTip(): go deep in boost ... qt/clientmodel.cpp:255 BlockTipChanged(): lock m_cached_tip_mutex ``` and ``` qt/clientmodel.cpp:119 ClientModel::getBestBlockHash(): lock m_cached_tip_mutex qt/clientmodel.cpp:121 ClientModel::getBestBlockHash(): call m_node.getBestBlockHash() interfaces/node.cpp:200 NodeImpl::getBestBlockHash(): lock cs_main ``` From `debug.log`: ``` POTENTIAL DEADLOCK DETECTED Previous lock order was: m_cs_chainstate validation.cpp:2851 (1) cs_main validation.cpp:2868 ::mempool.cs validation.cpp:2868 (2) clientmodel->m_cached_tip_mutex qt/clientmodel.cpp:255 Current lock order is: (2) m_cached_tip_mutex qt/clientmodel.cpp:119 (1) ::cs_main interfaces/node.cpp:200 ``` The possible deadlock was introduced in https://github.com/bitcoin/bitcoin/pull/17993
2020-05-23BlockTip struct created and connected to notifyHeaderTip and notifyBlockTip ↵furszy
signals.
2020-05-23Added best block hash to the NotifyHeaderTip and NotifyBlockTip signals.furszy
[ClientModel] best header/block hash cached.
2020-05-19qt: Add SynchronizationState enum to signal parameterHennadii Stepanov
2020-05-19refactor: Remove Node::getReindex() call from GUIHennadii Stepanov
2020-05-19refactor: Pass SynchronizationState enum to GUIHennadii Stepanov
Co-authored-by: Russell Yanofsky <russ@yanofsky.org>
2020-04-16scripted-diff: Bump copyright headersMarcoFalke
-BEGIN VERIFY SCRIPT- ./contrib/devtools/copyright_header.py update ./ -END VERIFY SCRIPT-
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-02-12gui: Throttle GUI update pace when -reindexHennadii Stepanov
Co-authored-by: Barry Deeney <mxaddict@codedmaster.com> Co-authored-by: Russell Yanofsky <russ@yanofsky.org>
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.
2019-12-30scripted-diff: Bump copyright of files changed in 2019MarcoFalke
-BEGIN VERIFY SCRIPT- ./contrib/devtools/copyright_header.py update ./ -END VERIFY SCRIPT-
2019-12-15[qt] remove unused parameter from getWarnings()John Newbery
2019-10-25gui: Make polling in ClientModel asynchronousJoão Barbosa
With this change polling runs in a different thread to prevent disturbing the event loop.
2019-07-08qt: Assert QMetaObject::invokeMethod resultJoão Barbosa
2019-06-02Make reasoning about dependencies easier by not including unused dependenciespracticalswift
2019-03-23Resolve the checkpoints <-> validation CD.251
This commit resolves the checkpoints -> validation -> checkpoints cirular dependency by moving `CheckPoints::GetLastCheckpoint(const CCheckpointData& data)` from `checkpoints.cpp` to `validation.cpp`.
2019-02-06Merge #15091: GUI: fix model overlay header syncWladimir J. van der Laan
e8db6b8044424a6fbb4b0a80acffc8c7fbf6be8b Qt: Fix update headers-count (Jonas Schnelli) 7bb45e4b7a71e0ff0e2bbeba5367022758efa5d4 Qt: update header count regardless of update delay (Jonas Schnelli) Pull request description: Update the block and header tip is constraint to have a minimal distance of 250ms between updates... which can lead to miss the last header update. The modal overlay then assumes we are still in header sync and the view get stuck in "syncing headers,..." (while it's actually syncing blocks). This removes the 250ms minimal delta for header updates as well as it fixes the correct display of how header updates should update the labels. Tree-SHA512: 57608dac822b135cd604fc6ba1c80f25c0202a6e20bb140362026615d4bf243ef4fcc254a11bad36419c554a222a2f4947438d4ce44aa14041d1874751643d68
2019-01-13Don't use zero as null pointer constant (-Wzero-as-null-pointer-constant)practicalswift
Qt-only changes.
2019-01-04Qt: update header count regardless of update delayJonas Schnelli
2018-12-29Merge #13743: refactor: Replace boost::bind with std::bindMarcoFalke
cb53b825c2 scripted-diff: Replace boost::bind with std::bind (Chun Kuan Lee) 2196c51821 refactor: Use boost::scoped_connection in signal/slot, also prefer range-based loop instead of std::transform (Chun Kuan Lee) Pull request description: Replace boost::bind with std::bind - In `src/rpc/server.cpp`, replace `std::transform` with simple loop. - In `src/validation.cpp`, store the `boost::signals2::connection` object and use it to disconnect. - In `src/validationinterface.cpp`, use 2 map to store the `boost::signals2::scoped_connection` object. Tree-SHA512: 6653cbe00036fecfc495340618efcba6d7be0227c752b37b81a27184433330f817e8de9257774e9b35828026cb55f11ee7f17d6c388aebe22c4a3df13b5092f0
2018-11-04scripted-diff: Move util files to separate directory.Jim Posen
-BEGIN VERIFY SCRIPT- mkdir -p src/util git mv src/util.h src/util/system.h git mv src/util.cpp src/util/system.cpp git mv src/utilmemory.h src/util/memory.h git mv src/utilmoneystr.h src/util/moneystr.h git mv src/utilmoneystr.cpp src/util/moneystr.cpp git mv src/utilstrencodings.h src/util/strencodings.h git mv src/utilstrencodings.cpp src/util/strencodings.cpp git mv src/utiltime.h src/util/time.h git mv src/utiltime.cpp src/util/time.cpp sed -i 's/<util\.h>/<util\/system\.h>/g' $(git ls-files 'src/*.h' 'src/*.cpp') sed -i 's/<utilmemory\.h>/<util\/memory\.h>/g' $(git ls-files 'src/*.h' 'src/*.cpp') sed -i 's/<utilmoneystr\.h>/<util\/moneystr\.h>/g' $(git ls-files 'src/*.h' 'src/*.cpp') sed -i 's/<utilstrencodings\.h>/<util\/strencodings\.h>/g' $(git ls-files 'src/*.h' 'src/*.cpp') sed -i 's/<utiltime\.h>/<util\/time\.h>/g' $(git ls-files 'src/*.h' 'src/*.cpp') sed -i 's/BITCOIN_UTIL_H/BITCOIN_UTIL_SYSTEM_H/g' src/util/system.h sed -i 's/BITCOIN_UTILMEMORY_H/BITCOIN_UTIL_MEMORY_H/g' src/util/memory.h sed -i 's/BITCOIN_UTILMONEYSTR_H/BITCOIN_UTIL_MONEYSTR_H/g' src/util/moneystr.h sed -i 's/BITCOIN_UTILSTRENCODINGS_H/BITCOIN_UTIL_STRENCODINGS_H/g' src/util/strencodings.h sed -i 's/BITCOIN_UTILTIME_H/BITCOIN_UTIL_TIME_H/g' src/util/time.h sed -i 's/ util\.\(h\|cpp\)/ util\/system\.\1/g' src/Makefile.am sed -i 's/utilmemory\.\(h\|cpp\)/util\/memory\.\1/g' src/Makefile.am sed -i 's/utilmoneystr\.\(h\|cpp\)/util\/moneystr\.\1/g' src/Makefile.am sed -i 's/utilstrencodings\.\(h\|cpp\)/util\/strencodings\.\1/g' src/Makefile.am sed -i 's/utiltime\.\(h\|cpp\)/util\/time\.\1/g' src/Makefile.am sed -i 's/-> util ->/-> util\/system ->/' test/lint/lint-circular-dependencies.sh sed -i 's/src\/util\.cpp/src\/util\/system\.cpp/g' test/lint/lint-format-strings.py test/lint/lint-locale-dependence.sh sed -i 's/src\/utilmoneystr\.cpp/src\/util\/moneystr\.cpp/g' test/lint/lint-locale-dependence.sh sed -i 's/src\/utilstrencodings\.\(h\|cpp\)/src\/util\/strencodings\.\1/g' test/lint/lint-locale-dependence.sh sed -i 's/src\\utilstrencodings\.cpp/src\\util\\strencodings\.cpp/' build_msvc/libbitcoinconsensus/libbitcoinconsensus.vcxproj -END VERIFY SCRIPT-
2018-10-20scripted-diff: Replace boost::bind with std::bindChun Kuan Lee
-BEGIN VERIFY SCRIPT- for j in $(seq 1 5) do sed -i "s/ _${j}/ std::placeholders::_${j}/g" $(git grep --name-only " _${j}" -- '*.cpp' '*.h') done sed -i "s/boost::bind/std::bind/g" $(git grep --name-only boost::bind -- '*.cpp' '*.h') sed -i "s/boost::ref/std::ref/g" $(git grep --name-only boost::ref -- '*.cpp' '*.h') sed -i '/boost\/bind/d' $(git grep --name-only boost/bind) -END VERIFY SCRIPT-
2018-10-06Add "Blocksdir" to Debug windowHennadii Stepanov
To get the current blocksdir is valuable for debug purposes after merging #12653.
2018-08-21qt: Use new Qt5 connect syntaxJoão Barbosa
2018-07-27Update copyright headers to 2018DrahtBot
2018-07-18Remove redundant forward declarationpracticalswift