Skip to content
Bitcoin Roots

v30.3-roots.1 · Commit 24: [PATCH 24/68] 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 ece797bfd9e731089a78a8c167e21eafa61051db..912c9aab56f1392395355fb7e5954ccdbc0f4175 100644

Download original patch · Release notes

Diff rows 1–39 of 39. 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,9 +13,11 @@
13
13
  #include <primitives/transaction_identifier.h>
14
14
  #include <support/allocators/secure.h>
15
15
 
16
+ #include <cstdint>
16
17
  #include <vector>
17
18
 
18
19
  #include <QObject>
20
+ #include <QThread>
19
21
 
20
22
  enum class OutputType;
21
23
 
@@ -156,6 +158,10 @@ public:
156
158
  // Otherwise, uses the wallet's cached available balance.
157
159
  CAmount getAvailableBalance(const wallet::CCoinControl* control);
158
160
 
161
+ uint64_t invalidateSweepRequests();
162
+ uint64_t requestSweep(SecureString private_key, CTxDestination destination, bool broadcast,
163
+ std::optional<Txid> expected_txid = std::nullopt);
164
+
159
165
  private:
160
166
  std::unique_ptr<interfaces::Wallet> m_wallet;
161
167
  std::unique_ptr<interfaces::Handler> m_handler_unload;
@@ -167,6 +173,9 @@ private:
167
173
  ClientModel* m_client_model;
168
174
  interfaces::Node& m_node;
169
175
 
176
+ uint64_t m_sweep_request_generation{0};
177
+ QObject m_sweep_context;
178
+ QThread m_sweep_thread;
170
179
  bool fForceCheckBalanceChanged{false};
171
180
 
172
181
  // Wallet has an options model for wallet-specific options
@@ -215,6 +224,9 @@ Q_SIGNALS:
215
224
 
216
225
  // Notify that there are now keys in the keypool
217
226
  void canGetAddressesChanged();
227
+ void sweepRequestInvalidated(uint64_t generation);
228
+ void sweepFinished(uint64_t generation, bool broadcast, bool success, const QString& error,
229
+ qint64 amount, qint64 fee, quint64 inputs, qint64 vsize, bool rbf, const QString& txid);
218
230
 
219
231
  void timerTimeout();
220
232