Skip to content
Bitcoin Roots

v29.4-roots.3 · Commit 24: [PATCH 24/30] feat(qt): add guarded private key sweep dialog

src/qt/walletmodel.h

Before: src/qt/walletmodel.h · After: src/qt/walletmodel.h

File metadata
index ab2096c1fefc907fadf515904d5a6110d540bcc7..54e942e766725385c42db3035713c8f879b5054a 100644

Download original patch · Release notes

Diff rows 1–38 of 38. Line numbers refer to the original before/after files.

+ Added− RemovedUnmarked lines are context.

Scroll the code area horizontally to read long lines. The two line-number columns refer to before and after.

src/qt/walletmodel.h CHANGED
@@ -13,8 +13,10 @@
13
13
  #include <support/allocators/secure.h>
14
14
 
15
15
  #include <vector>
16
+ #include <cstdint>
16
17
 
17
18
  #include <QObject>
19
+ #include <QThread>
18
20
 
19
21
  enum class OutputType;
20
22
 
@@ -155,6 +157,10 @@ public:
155
157
  // Otherwise, uses the wallet's cached available balance.
156
158
  CAmount getAvailableBalance(const wallet::CCoinControl* control);
157
159
 
160
+ uint64_t invalidateSweepRequests();
161
+ uint64_t requestSweep(SecureString private_key, CTxDestination destination, bool broadcast,
162
+ std::optional<uint256> expected_txid = std::nullopt);
163
+
158
164
  private:
159
165
  std::unique_ptr<interfaces::Wallet> m_wallet;
160
166
  std::unique_ptr<interfaces::Handler> m_handler_unload;
@@ -168,6 +174,9 @@ private:
168
174
  interfaces::Node& m_node;
169
175
 
170
176
  bool fHaveWatchOnly;
177
+ uint64_t m_sweep_request_generation{0};
178
+ QObject m_sweep_context;
179
+ QThread m_sweep_thread;
171
180
  bool fForceCheckBalanceChanged{false};
172
181
 
173
182
  // Wallet has an options model for wallet-specific options
@@ -219,6 +228,9 @@ Q_SIGNALS:
219
228
 
220
229
  // Notify that there are now keys in the keypool
221
230
  void canGetAddressesChanged();
231
+ void sweepRequestInvalidated(uint64_t generation);
232
+ void sweepFinished(uint64_t generation, bool broadcast, bool success, const QString& error,
233
+ qint64 amount, qint64 fee, quint64 inputs, qint64 vsize, bool rbf, const QString& txid);
222
234
 
223
235
  void timerTimeout();
224
236