v30.3-roots.1 · Commit 23: [PATCH 23/68] feat(wallet): add transient private-key sweep RPC
src/wallet/spend.h
Before: src/wallet/spend.h · After: src/wallet/spend.h
File metadata
index 1f4d08e22fbd9291720f35b68ca1bbe105233fa4..1939e9ce59267cb9a3a1e3228078d43d131b54e0 100644
Download original patch · Release notes
Diff rows 1–32 of 32. 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/wallet/spend.h
CHANGED
|
@@ -12,6 +12,7 @@
|
|
| 12 |
#include <wallet/transaction.h>
|
| 13 |
#include <wallet/wallet.h>
|
| 14 |
|
|
|
|
| 15 |
#include <map>
|
| 16 |
#include <memory>
|
| 17 |
#include <optional>
|
|
@@ -19,9 +20,25 @@
|
|
| 19 |
#include <unordered_set>
|
| 20 |
#include <vector>
|
| 21 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 22 |
class FastRandomContext;
|
| 23 |
|
| 24 |
namespace wallet {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 25 |
/** Pick an automatic anti-fee-sniping locktime that does not collide with reserved policy markers. */
|
| 26 |
uint32_t GetAntiFeeSnipingLockTime(int block_height, FastRandomContext& rng_fast);
|
| 27 |
|
|
|
|
| 12 |
#include <wallet/transaction.h>
|
| 13 |
#include <wallet/wallet.h>
|
| 14 |
|
| 15 |
+
#include <functional>
|
| 16 |
#include <map>
|
| 17 |
#include <memory>
|
| 18 |
#include <optional>
|
|
|
|
| 20 |
#include <unordered_set>
|
| 21 |
#include <vector>
|
| 22 |
|
| 23 |
+
class COutPoint;
|
| 24 |
+
class Coin;
|
| 25 |
+
class CScript;
|
| 26 |
+
struct FlatSigningProvider;
|
| 27 |
+
|
| 28 |
class FastRandomContext;
|
| 29 |
|
| 30 |
namespace wallet {
|
| 31 |
+
struct SweepTransactionResult
|
| 32 |
+
{
|
| 33 |
+
CTransactionRef tx;
|
| 34 |
+
CAmount amount;
|
| 35 |
+
CAmount fee;
|
| 36 |
+
};
|
| 37 |
+
|
| 38 |
+
using SweepBroadcastFn = std::function<bool(const CTransactionRef&, std::string&)>;
|
| 39 |
+
util::Result<SweepTransactionResult> CreateSweepTransaction(CWallet& wallet, FlatSigningProvider& provider,
|
| 40 |
+
const std::map<COutPoint, Coin>& coins,
|
| 41 |
+
const CScript& destination, const SweepBroadcastFn& broadcast);
|
| 42 |
/** Pick an automatic anti-fee-sniping locktime that does not collide with reserved policy markers. */
|
| 43 |
uint32_t GetAntiFeeSnipingLockTime(int block_height, FastRandomContext& rng_fast);
|
| 44 |
|