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. Before is on the left; after is on the right. Unified view fits narrow screens more easily.

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