Skip to content
Bitcoin Roots

v30.3-roots.1 · Commit 25: [PATCH 25/68] feat(wallet): expose advanced coin control facts

src/interfaces/wallet.h

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

File metadata
index da0d9eccd875900899e990c8f1287ccd4b3f1ab2..e8015073e0e274bb37d7d0593de56f9c89bf9cbe 100644

Download original patch · Release notes

Diff rows 1–50 of 50. 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/interfaces/wallet.h CHANGED
@@ -9,6 +9,7 @@
9
9
  #include <common/signmessage.h>
10
10
  #include <consensus/amount.h>
11
11
  #include <interfaces/chain.h>
12
+ #include <policy/feerate.h>
12
13
  #include <primitives/transaction_identifier.h>
13
14
  #include <pubkey.h>
14
15
  #include <script/script.h>
@@ -27,7 +28,6 @@
27
28
  #include <utility>
28
29
  #include <vector>
29
30
 
30
- class CFeeRate;
31
31
  class CKey;
32
32
  enum class FeeReason;
33
33
  enum class OutputType;
@@ -256,7 +256,8 @@ public:
256
256
  virtual CoinsList listCoins() = 0;
257
257
 
258
258
  //! Return wallet transaction output information.
259
- virtual std::vector<WalletTxOut> getCoins(const std::vector<COutPoint>& outputs) = 0;
259
+ virtual std::vector<WalletTxOut> getCoins(const std::vector<COutPoint>& outputs,
260
+ const std::optional<CFeeRate>& feerate = std::nullopt) = 0;
260
261
 
261
262
  //! Get required fee.
262
263
  virtual CAmount getRequiredFee(unsigned int tx_bytes) = 0;
@@ -433,10 +434,27 @@ struct WalletTxStatus
433
434
  //! Wallet transaction output.
434
435
  struct WalletTxOut
435
436
  {
437
+ //! Outpoint identifying this output in the wallet.
438
+ COutPoint outpoint;
436
439
  CTxOut txout;
440
+ //! Wallet's smart transaction time for this output.
437
441
  int64_t time;
438
442
  int depth_in_main_chain = -1;
439
443
  bool is_spent = false;
444
+ //! Wallet-owned facts used to present coin-control choices.
445
+ int input_bytes = -1;
446
+ std::optional<CAmount> effective_value;
447
+ CAmount ancestor_bump_fees{0};
448
+ bool is_spendable = false;
449
+ bool is_solvable = false;
450
+ bool is_safe = false;
451
+ bool is_locked = false;
452
+ bool is_reused = false;
453
+ bool is_immature = false;
454
+ bool is_change = false;
455
+ CTxDestination address;
456
+ CTxDestination grouping_address;
457
+ std::string label;
440
458
  };
441
459
 
442
460
  //! Migrated wallet info