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. Before is on the left; after is on the right. Unified view fits narrow screens more easily.
src/interfaces/wallet.h
CHANGED
|
@@ -58,6 +58,17 @@ struct WalletTxOut;
|
|
| 58 |
struct WalletTxStatus;
|
| 59 |
struct WalletMigrationResult;
|
| 60 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 61 |
using WalletOrderForm = std::vector<std::pair<std::string, std::string>>;
|
| 62 |
using WalletValueMap = std::map<std::string, std::string>;
|
| 63 |
|
|
@@ -107,6 +118,12 @@ public:
|
|
| 107 |
//! Return whether wallet has private key.
|
| 108 |
virtual bool isSpendable(const CTxDestination& dest) = 0;
|
| 109 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 110 |
//! Return whether wallet has watch only keys.
|
| 111 |
virtual bool haveWatchOnly() = 0;
|
| 112 |
|
|
|
|
| 58 |
struct WalletTxStatus;
|
| 59 |
struct WalletMigrationResult;
|
| 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 |
+
|
| 72 |
using WalletOrderForm = std::vector<std::pair<std::string, std::string>>;
|
| 73 |
using WalletValueMap = std::map<std::string, std::string>;
|
| 74 |
|
|
|
|
| 118 |
//! Return whether wallet has private key.
|
| 119 |
virtual bool isSpendable(const CTxDestination& dest) = 0;
|
| 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 |
+
|
| 127 |
//! Return whether wallet has watch only keys.
|
| 128 |
virtual bool haveWatchOnly() = 0;
|
| 129 |
|