Skip to content
Bitcoin Roots

v29.4-roots.4 · Commit 24: [PATCH 24/37] 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. Before is on the left; after is on the right. Unified view fits narrow screens more easily.

src/qt/walletmodel.h CHANGED
@@ -13,8 +13,10 @@
13
  #include <support/allocators/secure.h>
14
 
15
  #include <vector>
 
16
 
17
  #include <QObject>
 
18
 
19
  enum class OutputType;
20
 
@@ -155,6 +157,10 @@ public:
155
  // Otherwise, uses the wallet's cached available balance.
156
  CAmount getAvailableBalance(const wallet::CCoinControl* control);
157
 
 
 
 
 
158
  private:
159
  std::unique_ptr<interfaces::Wallet> m_wallet;
160
  std::unique_ptr<interfaces::Handler> m_handler_unload;
@@ -168,6 +174,9 @@ private:
168
  interfaces::Node& m_node;
169
 
170
  bool fHaveWatchOnly;
 
 
 
171
  bool fForceCheckBalanceChanged{false};
172
 
173
  // Wallet has an options model for wallet-specific options
@@ -219,6 +228,9 @@ Q_SIGNALS:
219
 
220
  // Notify that there are now keys in the keypool
221
  void canGetAddressesChanged();
 
 
 
222
 
223
  void timerTimeout();
224
 
 
13
  #include <support/allocators/secure.h>
14
 
15
  #include <vector>
16
+ #include <cstdint>
17
 
18
  #include <QObject>
19
+ #include <QThread>
20
 
21
  enum class OutputType;
22
 
 
157
  // Otherwise, uses the wallet's cached available balance.
158
  CAmount getAvailableBalance(const wallet::CCoinControl* control);
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
+
164
  private:
165
  std::unique_ptr<interfaces::Wallet> m_wallet;
166
  std::unique_ptr<interfaces::Handler> m_handler_unload;
 
174
  interfaces::Node& m_node;
175
 
176
  bool fHaveWatchOnly;
177
+ uint64_t m_sweep_request_generation{0};
178
+ QObject m_sweep_context;
179
+ QThread m_sweep_thread;
180
  bool fForceCheckBalanceChanged{false};
181
 
182
  // Wallet has an options model for wallet-specific options
 
228
 
229
  // Notify that there are now keys in the keypool
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);
234
 
235
  void timerTimeout();
236