v30.3-roots.1 · Commit 24: [PATCH 24/68] feat(qt): add guarded private key sweep dialog
src/qt/sweepdialog.h
Before: /dev/null · After: src/qt/sweepdialog.h
File metadata
new file mode 100644 index 0000000000000000000000000000000000000000..f184ca784ed1590a7cac3a35dc8685a7131f2d70
Download original patch · Release notes
Diff rows 1–50 of 50. 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/sweepdialog.h
ADDED
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
// Copyright (c) 2026 The Bitcoin Roots developers
|
|
2
|
+
// Distributed under the MIT software license, see the accompanying file COPYING or http://www.opensource.org/licenses/MIT.
|
|
3
|
+
|
|
4
|
+
#ifndef BITCOIN_QT_SWEEPDIALOG_H
|
|
5
|
+
#define BITCOIN_QT_SWEEPDIALOG_H
|
|
6
|
+
|
|
7
|
+
#include <QDialog>
|
|
8
|
+
#include <support/allocators/secure.h>
|
|
9
|
+
|
|
10
|
+
#include <cstdint>
|
|
11
|
+
|
|
12
|
+
class QLabel;
|
|
13
|
+
class QLineEdit;
|
|
14
|
+
class QPushButton;
|
|
15
|
+
class WalletModel;
|
|
16
|
+
|
|
17
|
+
class SweepDialog : public QDialog
|
|
18
|
+
{
|
|
19
|
+
Q_OBJECT
|
|
20
|
+
public:
|
|
21
|
+
explicit SweepDialog(WalletModel* wallet_model, QWidget* parent = nullptr);
|
|
22
|
+
~SweepDialog() override;
|
|
23
|
+
|
|
24
|
+
private Q_SLOTS:
|
|
25
|
+
void preview();
|
|
26
|
+
void broadcast();
|
|
27
|
+
void invalidate();
|
|
28
|
+
void clearSensitive();
|
|
29
|
+
void handleSweepFinished(uint64_t generation, bool broadcast, bool success, const QString& error,
|
|
30
|
+
qint64 amount, qint64 fee, quint64 inputs, qint64 vsize, bool rbf, const QString& txid);
|
|
31
|
+
|
|
32
|
+
private:
|
|
33
|
+
void setResult(const QString& text, bool can_broadcast);
|
|
34
|
+
void setBusy(bool busy);
|
|
35
|
+
WalletModel* m_wallet_model;
|
|
36
|
+
QLineEdit* m_private_key;
|
|
37
|
+
QLineEdit* m_destination;
|
|
38
|
+
QLabel* m_result;
|
|
39
|
+
QPushButton* m_preview;
|
|
40
|
+
QPushButton* m_broadcast;
|
|
41
|
+
bool m_busy{false};
|
|
42
|
+
bool m_preview_current{false};
|
|
43
|
+
//! Incremented for every user-visible invalidation. Async completions must
|
|
44
|
+
//! compare their captured generation before updating this dialog.
|
|
45
|
+
uint64_t m_request_generation{0};
|
|
46
|
+
SecureString m_private_key_cache;
|
|
47
|
+
QString m_preview_txid;
|
|
48
|
+
};
|
|
49
|
+
|
|
50
|
+
#endif // BITCOIN_QT_SWEEPDIALOG_H
|