Skip to content
Bitcoin Roots

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. The two line-number columns refer to before and after.

src/wallet/spend.h CHANGED
@@ -12,6 +12,7 @@
12
12
  #include <wallet/transaction.h>
13
13
  #include <wallet/wallet.h>
14
14
 
15
+ #include <functional>
15
16
  #include <map>
16
17
  #include <memory>
17
18
  #include <optional>
@@ -19,9 +20,25 @@
19
20
  #include <unordered_set>
20
21
  #include <vector>
21
22
 
23
+ class COutPoint;
24
+ class Coin;
25
+ class CScript;
26
+ struct FlatSigningProvider;
27
+
22
28
  class FastRandomContext;
23
29
 
24
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);
25
42
  /** Pick an automatic anti-fee-sniping locktime that does not collide with reserved policy markers. */
26
43
  uint32_t GetAntiFeeSnipingLockTime(int block_height, FastRandomContext& rng_fast);
27
44