diff options
author | glozow <gloriajzhao@gmail.com> | 2023-02-27 17:53:20 +0000 |
---|---|---|
committer | glozow <gloriajzhao@gmail.com> | 2023-02-27 18:09:31 +0000 |
commit | c8c85ca16e6abbf9072dee9e526f09b6fcb35037 (patch) | |
tree | 2bf39d29063a9f2d22c2573d84390652b2593e59 /src/qt | |
parent | 2b87e905857ba456db2cb3d0297a3102f17417be (diff) | |
parent | 784a754aa47ce10c6fd99c09cdfc76ee9bc91652 (diff) | |
download | bitcoin-c8c85ca16e6abbf9072dee9e526f09b6fcb35037.tar.xz |
Merge bitcoin/bitcoin#26878: [24.x] Backports
784a754aa47ce10c6fd99c09cdfc76ee9bc91652 wallet, rpc: Update migratewallet help text for encrypted wallets (Andrew Chow)
debcfe313a22fddc2a6247c55f3c7893f6134c05 tests: Tests for migrating wallets by name, and providing passphrase (Andrew Chow)
ccc72fecd7287471bf8c3858a4e6c2ddadb64863 wallet: Be able to unlock the wallet for migration (Andrew Chow)
50dd8b13dfc070b550680617e76eff1c09af3a58 rpc: Allow users to specify wallet name for migratewallet (Andrew Chow)
648b06256da65b4513977e351aabf3e5c06ce060 wallet: Allow MigrateLegacyToDescriptor to take a wallet name (Andrew Chow)
ab3bd457cdb5c5ee2626081d703d675c2573f28a i2p: use consistent number of tunnels with i2pd and Java I2P (Vasil Dimov)
29cdf42226c0983076701552b351f08351dd54a5 i2p: lower the number of tunnels for transient sessions (Vasil Dimov)
5027e93b6a1e5a5c87b9450c60e2a4572eb32653 i2p: reuse created I2P sessions if not used (Vasil Dimov)
a62c541ae8a579d19b8fc55bbb922f0939ab6110 wallet: reuse change dest when recreating TX with avoidpartialspends (Matthew Zipkin)
64e7db6f4f256656f4d78a96b07e51f7d5c6d526 Zero out wallet master key upon lock (John Moffett)
b7e242ecb3aa0074aea753e5bc9f8d22674e8294 Correctly limit overview transaction list (John Moffett)
cff67180b3ba9ab53e01d44769059aa5559c01f7 depends: fix systemtap download URL (fanquake)
7cf73dfed5757819c0a5485ae05e8e1a57528a0e Add missing includes to fix gcc-13 compile error (MarcoFalke)
07397cdedeffb4da0aedd454d4539d65a0204291 addrdb: Only call Serialize() once (Martin Zumsande)
91f83dbeb197fc0fff574d9e29b4560b1d236bec hash: add HashedSourceWriter (Martin Zumsande)
5c824ac5e1e35f77e323319849b03ac9d8cf45d3 For feebump, ignore abandoned descendant spends (John Moffett)
428dcd51e6adab564ffb87ed678317924868572f wallet: Skip rescanning if wallet is more recent than tip (Andrew Chow)
cbcdafa471da3d1edd183143ae9d433627ef16dd test: wallet: check that labels are migrated to watchonly wallet (Sebastian Falbesoner)
342abfb3f4368fcdb67f3002c5558d4106d9bf83 wallet: fully migrate address book entries for watchonly/solvable wallets (Sebastian Falbesoner)
Pull request description:
Backports:
* https://github.com/bitcoin/bitcoin/pull/26595
* https://github.com/bitcoin/bitcoin/pull/26675
* https://github.com/bitcoin/bitcoin/pull/26679
* https://github.com/bitcoin/bitcoin/pull/26761
* https://github.com/bitcoin/bitcoin/pull/26837
* https://github.com/bitcoin/bitcoin/pull/26909
* https://github.com/bitcoin/bitcoin/pull/26924
* https://github.com/bitcoin/bitcoin/pull/26944
* https://github.com/bitcoin-core/gui/pull/704
* https://github.com/bitcoin/bitcoin/pull/27053
* https://github.com/bitcoin/bitcoin/pull/27080
ACKs for top commit:
instagibbs:
ACK https://github.com/bitcoin/bitcoin/pull/26878/commits/784a754aa47ce10c6fd99c09cdfc76ee9bc91652
achow101:
ACK 784a754aa47ce10c6fd99c09cdfc76ee9bc91652
hebasto:
ACK 784a754aa47ce10c6fd99c09cdfc76ee9bc91652, I've made backporting locally and got a diff between my branch and this PR as follows:
Tree-SHA512: 8ea84aa02d7907ff1e202e1302b441ce9ed2198bf383620ad40056a5d7e8ea88e1047abef0b92d85648016bf9b3195c974be3806ccebd85bef4f85c326869e43
Diffstat (limited to 'src/qt')
-rw-r--r-- | src/qt/overviewpage.cpp | 15 | ||||
-rw-r--r-- | src/qt/overviewpage.h | 1 | ||||
-rw-r--r-- | src/qt/transactionfilterproxy.cpp | 18 | ||||
-rw-r--r-- | src/qt/transactionfilterproxy.h | 6 |
4 files changed, 15 insertions, 25 deletions
diff --git a/src/qt/overviewpage.cpp b/src/qt/overviewpage.cpp index 85a3c36f39..d47afa9874 100644 --- a/src/qt/overviewpage.cpp +++ b/src/qt/overviewpage.cpp @@ -264,7 +264,6 @@ void OverviewPage::setWalletModel(WalletModel *model) // Set up transaction list filter.reset(new TransactionFilterProxy()); filter->setSourceModel(model->getTransactionTableModel()); - filter->setLimit(NUM_ITEMS); filter->setDynamicSortFilter(true); filter->setSortRole(Qt::EditRole); filter->setShowInactive(false); @@ -273,6 +272,10 @@ void OverviewPage::setWalletModel(WalletModel *model) ui->listTransactions->setModel(filter.get()); ui->listTransactions->setModelColumn(TransactionTableModel::ToAddress); + connect(filter.get(), &TransactionFilterProxy::rowsInserted, this, &OverviewPage::LimitTransactionRows); + connect(filter.get(), &TransactionFilterProxy::rowsRemoved, this, &OverviewPage::LimitTransactionRows); + connect(filter.get(), &TransactionFilterProxy::rowsMoved, this, &OverviewPage::LimitTransactionRows); + LimitTransactionRows(); // Keep up to date with wallet setBalance(model->getCachedBalance()); connect(model, &WalletModel::balanceChanged, this, &OverviewPage::setBalance); @@ -301,6 +304,16 @@ void OverviewPage::changeEvent(QEvent* e) QWidget::changeEvent(e); } +// Only show most recent NUM_ITEMS rows +void OverviewPage::LimitTransactionRows() +{ + if (filter && ui->listTransactions && ui->listTransactions->model() && filter.get() == ui->listTransactions->model()) { + for (int i = 0; i < filter->rowCount(); ++i) { + ui->listTransactions->setRowHidden(i, i >= NUM_ITEMS); + } + } +} + void OverviewPage::updateDisplayUnit() { if (walletModel && walletModel->getOptionsModel()) { diff --git a/src/qt/overviewpage.h b/src/qt/overviewpage.h index 56f45907db..e171ddf06a 100644 --- a/src/qt/overviewpage.h +++ b/src/qt/overviewpage.h @@ -60,6 +60,7 @@ private: std::unique_ptr<TransactionFilterProxy> filter; private Q_SLOTS: + void LimitTransactionRows(); void updateDisplayUnit(); void handleTransactionClicked(const QModelIndex &index); void updateAlerts(const QString &warnings); diff --git a/src/qt/transactionfilterproxy.cpp b/src/qt/transactionfilterproxy.cpp index 3be7e1a969..33ca74231f 100644 --- a/src/qt/transactionfilterproxy.cpp +++ b/src/qt/transactionfilterproxy.cpp @@ -17,7 +17,6 @@ TransactionFilterProxy::TransactionFilterProxy(QObject *parent) : typeFilter(ALL_TYPES), watchOnlyFilter(WatchOnlyFilter_All), minAmount(0), - limitRows(-1), showInactive(true) { } @@ -92,25 +91,8 @@ void TransactionFilterProxy::setWatchOnlyFilter(WatchOnlyFilter filter) invalidateFilter(); } -void TransactionFilterProxy::setLimit(int limit) -{ - this->limitRows = limit; -} - void TransactionFilterProxy::setShowInactive(bool _showInactive) { this->showInactive = _showInactive; invalidateFilter(); } - -int TransactionFilterProxy::rowCount(const QModelIndex &parent) const -{ - if(limitRows != -1) - { - return std::min(QSortFilterProxyModel::rowCount(parent), limitRows); - } - else - { - return QSortFilterProxyModel::rowCount(parent); - } -} diff --git a/src/qt/transactionfilterproxy.h b/src/qt/transactionfilterproxy.h index fd9be52842..9b43981bc2 100644 --- a/src/qt/transactionfilterproxy.h +++ b/src/qt/transactionfilterproxy.h @@ -42,14 +42,9 @@ public: void setMinAmount(const CAmount& minimum); void setWatchOnlyFilter(WatchOnlyFilter filter); - /** Set maximum number of rows returned, -1 if unlimited. */ - void setLimit(int limit); - /** Set whether to show conflicted transactions. */ void setShowInactive(bool showInactive); - int rowCount(const QModelIndex &parent = QModelIndex()) const override; - protected: bool filterAcceptsRow(int source_row, const QModelIndex & source_parent) const override; @@ -60,7 +55,6 @@ private: quint32 typeFilter; WatchOnlyFilter watchOnlyFilter; CAmount minAmount; - int limitRows; bool showInactive; }; |