v29.4-roots.3 · Commit 24: [PATCH 24/30] feat(qt): add guarded private key sweep dialog
src/interfaces/wallet.h
Before: src/interfaces/wallet.h · After: src/interfaces/wallet.h
File metadata
index f7aa659c11b8c0039a34c9d65d09909dd91006ed..1cdff039b357ca45ec2fe0649f9b07e25ccb20e6 100644
Download original patch · Release notes
Diff rows 1–29 of 29. 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/interfaces/wallet.h
CHANGED
|
@@ -58,6 +58,17 @@ struct WalletTxOut;
|
|
|
58
58
|
struct WalletTxStatus;
|
|
59
59
|
struct WalletMigrationResult;
|
|
60
60
|
|
|
61
|
+
//! Result of a transient-private-key sweep. The supplied key is never retained
|
|
62
|
+
//! by this interface or by the wallet.
|
|
63
|
+
struct WalletSweepResult {
|
|
64
|
+
CTransactionRef tx;
|
|
65
|
+
CAmount amount{0};
|
|
66
|
+
CAmount fee{0};
|
|
67
|
+
size_t inputs{0};
|
|
68
|
+
int64_t vsize{0};
|
|
69
|
+
bool broadcast{false};
|
|
70
|
+
};
|
|
71
|
+
|
|
61
72
|
using WalletOrderForm = std::vector<std::pair<std::string, std::string>>;
|
|
62
73
|
using WalletValueMap = std::map<std::string, std::string>;
|
|
63
74
|
|
|
@@ -107,6 +118,12 @@ public:
|
|
|
107
118
|
//! Return whether wallet has private key.
|
|
108
119
|
virtual bool isSpendable(const CTxDestination& dest) = 0;
|
|
109
120
|
|
|
121
|
+
//! Sweep one transient private key to a destination controlled by this wallet.
|
|
122
|
+
virtual util::Result<WalletSweepResult> sweepPrivateKey(const SecureString& private_key,
|
|
123
|
+
const CTxDestination& destination,
|
|
124
|
+
bool broadcast,
|
|
125
|
+
const std::optional<uint256>& expected_txid = std::nullopt) = 0;
|
|
126
|
+
|
|
110
127
|
//! Return whether wallet has watch only keys.
|
|
111
128
|
virtual bool haveWatchOnly() = 0;
|
|
112
129
|
|