Skip to content
Bitcoin Roots

v31.1-roots.1 · Commit 6: [PATCH 06/17] feat(wallet): preserve Roots signing and spend controls on v31

src/wallet/spend.h

Before: src/wallet/spend.h · After: src/wallet/spend.h

File metadata
index 925111dce031be17bf00693e3504f2c3f7215578..29c63744eccaeb0cd27c9035a0510bdc238353ad 100644

Download original patch · Release notes

Diff rows 1–40 of 40. 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
@@ -5,6 +5,7 @@
5
  #ifndef BITCOIN_WALLET_SPEND_H
6
  #define BITCOIN_WALLET_SPEND_H
7
 
 
8
  #include <consensus/amount.h>
9
  #include <policy/fees/block_policy_estimator.h>
10
  #include <util/result.h>
@@ -20,7 +21,33 @@
20
  #include <unordered_set>
21
  #include <vector>
22
 
 
 
 
 
 
 
 
 
23
  namespace wallet {
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
24
  /** Get the marginal bytes if spending the specified output from this transaction.
25
  * Use CoinControl to determine whether to expect signature grinding when calculating the size of the input spend. */
26
  int CalculateMaximumSignedInputSize(const CTxOut& txout, const CWallet* pwallet, const CCoinControl* coin_control);
 
5
  #ifndef BITCOIN_WALLET_SPEND_H
6
  #define BITCOIN_WALLET_SPEND_H
7
 
8
+ #include <functional>
9
  #include <consensus/amount.h>
10
  #include <policy/fees/block_policy_estimator.h>
11
  #include <util/result.h>
 
21
  #include <unordered_set>
22
  #include <vector>
23
 
24
+ class COutPoint;
25
+ class Coin;
26
+ class CScript;
27
+ class SigningProvider;
28
+ namespace interfaces { class SweepAuthorization; }
29
+
30
+ class FastRandomContext;
31
+
32
  namespace wallet {
33
+ //! Require a selected local-key descriptor wallet and matching signing material.
34
+ bool CanSweepTo(const CWallet& wallet, const CScript& destination) EXCLUSIVE_LOCKS_REQUIRED(wallet.cs_wallet);
35
+
36
+ struct SweepTransactionResult
37
+ {
38
+ CTransactionRef tx;
39
+ CAmount amount;
40
+ CAmount fee;
41
+ };
42
+
43
+ using SweepBroadcastFn = std::function<bool(const CTransactionRef&, std::string&)>;
44
+ util::Result<SweepTransactionResult> CreateSweepTransaction(CWallet& wallet, const SigningProvider& provider,
45
+ const std::map<COutPoint, Coin>& coins,
46
+ const CScript& destination, const SweepBroadcastFn& broadcast,
47
+ interfaces::SweepAuthorization& authorization);
48
+ /** Pick an automatic anti-fee-sniping locktime without reserved policy markers. */
49
+ uint32_t GetAntiFeeSnipingLockTime(int block_height, FastRandomContext& rng_fast);
50
+
51
  /** Get the marginal bytes if spending the specified output from this transaction.
52
  * Use CoinControl to determine whether to expect signature grinding when calculating the size of the input spend. */
53
  int CalculateMaximumSignedInputSize(const CTxOut& txout, const CWallet* pwallet, const CCoinControl* coin_control);