Skip to content
Bitcoin Roots

v29.4-roots.3 · Commit 23: [PATCH 23/30] 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 ac5a080cac7d8c4a0b5662b8f3d509f7252e8526..b6ba26454dbdcfca9ec00cd8bf719a3241f4089a 100644

Download original patch · Release notes

Diff rows 1–28 of 28. 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
@@ -13,10 +13,28 @@
13
13
  #include <wallet/wallet.h>
14
14
 
15
15
  #include <optional>
16
+ #include <functional>
17
+ #include <map>
18
+
19
+ class COutPoint;
20
+ class Coin;
21
+ class CScript;
22
+ struct FlatSigningProvider;
16
23
 
17
24
  class FastRandomContext;
18
25
 
19
26
  namespace wallet {
27
+ struct SweepTransactionResult
28
+ {
29
+ CTransactionRef tx;
30
+ CAmount amount;
31
+ CAmount fee;
32
+ };
33
+
34
+ using SweepBroadcastFn = std::function<bool(const CTransactionRef&, std::string&)>;
35
+ util::Result<SweepTransactionResult> CreateSweepTransaction(CWallet& wallet, FlatSigningProvider& provider,
36
+ const std::map<COutPoint, Coin>& coins,
37
+ const CScript& destination, const SweepBroadcastFn& broadcast);
20
38
  /** Pick an automatic anti-fee-sniping locktime that does not collide with reserved policy markers. */
21
39
  uint32_t GetAntiFeeSnipingLockTime(int block_height, FastRandomContext& rng_fast);
22
40