You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Merge #7072: feat(qt): introduce Wallet::startRescan() to replace append-and-restart method in Qt wallet, enable wallet rescan for multiple loaded wallets
931707c feat(qt): enable wallet rescan for multiple loaded wallets (Kittywhiskers Van Gogh)
025df83 qt: switch over to rescan wallet activity (Kittywhiskers Van Gogh)
9e16077 qt: use `QPointer` to prevent potential dangling pointer on unload (Kittywhiskers Van Gogh)
9fed372 qt: add rescan wallet activity (Kittywhiskers Van Gogh)
8b73a88 qt: add interface method to trigger rescans (Kittywhiskers Van Gogh)
9ac357b qt: de-emphasize runtime arguments, isolate code path to wallet builds (Kittywhiskers Van Gogh)
Pull request description:
## Motivation
[bitcoin#23123](bitcoin#23123) removes the `-rescan` startup parameter outright and users are expected to utilise the `rescanblockchain` RPC instead. This requires us to rework how the rescan option is implemented in Dash Qt, which uses the startup parameter.
This pull request replaces it by implementing the core rescan logic in the wallet interface (as opposed to trying to invoke an RPC call from the Qt wallet, which would violate separation of concerns) and then implementing a wallet activity to avoid blocking the main thread.
An additional benefit of this approach is that the rescan happens immediately without the overhead of a client restart.
## Additional Information
* To avoid a potential race condition where a wallet could unloaded before the rescan can be triggered, `m_rescan_wallet_model` is now a `QPointer` (which will auto-reset when the underlying entity is destroyed, [source](https://doc.qt.io/qt-6/qpointer.html)) and we do one final check in the one-shot lambda before resolving the pointer.
## Breaking Changes
None expected.
## Checklist
- [x] I have performed a self-review of my own code
- [x] I have commented my code, particularly in hard-to-understand areas
- [x] I have added or updated relevant unit/integration/functional/e2e tests **(note: N/A)**
- [x] I have made corresponding changes to the documentation **(note: N/A)**
- [x] I have assigned this pull request to a milestone _(for repository code-owners and collaborators only)_
ACKs for top commit:
UdjinM6:
light ACK 931707c
Tree-SHA512: 0a53c3e1679fbdb84f50a553ffc8513db584827b072aa9fcc5a6f6cee7b7fcd54d971741d1528bc1914671417442c433233582910a089398eff7eb7b63d1c038
<string>The buttons below will restart the wallet with command-line options to repair the wallet, fix issues with corrupt blockchain files or missing/obsolete transactions.</string>
1741
+
<string>The buttons below will trigger repair actions to fix issues with corrupt files or missing/obsolete transactions.</string>
1742
1742
</property>
1743
1743
<propertyname="wordWrap">
1744
1744
<bool>true</bool>
@@ -1758,14 +1758,14 @@
1758
1758
</size>
1759
1759
</property>
1760
1760
<propertyname="text">
1761
-
<string>Rescan blockchain files 1</string>
1761
+
<string>Rescan Chain</string>
1762
1762
</property>
1763
1763
</widget>
1764
1764
</item>
1765
1765
<itemrow="3"column="1">
1766
1766
<widgetclass="QLabel"name="label_repair_rescan1">
1767
1767
<propertyname="text">
1768
-
<string>-rescan=1: Rescan the block chain for missing wallet transactions starting from wallet creation time.</string>
1768
+
<string>Rescan the chain for missing wallet transactions starting from wallet creation time.</string>
1769
1769
</property>
1770
1770
<propertyname="wordWrap">
1771
1771
<bool>true</bool>
@@ -1781,14 +1781,14 @@
1781
1781
</size>
1782
1782
</property>
1783
1783
<propertyname="text">
1784
-
<string>Rescan blockchain files 2</string>
1784
+
<string>Rescan Chain (full)</string>
1785
1785
</property>
1786
1786
</widget>
1787
1787
</item>
1788
1788
<itemrow="4"column="1">
1789
1789
<widgetclass="QLabel"name="label_repair_rescan2">
1790
1790
<propertyname="text">
1791
-
<string>-rescan=2: Rescan the block chain for missing wallet transactions starting from genesis block.</string>
1791
+
<string>Rescan the chain for missing wallet transactions starting from genesis block.</string>
1792
1792
</property>
1793
1793
<propertyname="wordWrap">
1794
1794
<bool>true</bool>
@@ -1798,14 +1798,14 @@
1798
1798
<itemrow="5"column="0">
1799
1799
<widgetclass="QPushButton"name="btn_reindex">
1800
1800
<propertyname="text">
1801
-
<string>Rebuild index</string>
1801
+
<string>Rebuild Index</string>
1802
1802
</property>
1803
1803
</widget>
1804
1804
</item>
1805
1805
<itemrow="5"column="1">
1806
1806
<widgetclass="QLabel"name="label_repair_reindex">
1807
1807
<propertyname="text">
1808
-
<string>-reindex: Rebuild block chain index from current blk000??.dat files.</string>
1808
+
<string>Restarts the client to rebuild the chain index from current blk000??.dat files.</string>
0 commit comments