v29.4-roots.3 · Commit 25: [PATCH 25/30] feat(wallet): expose advanced coin control facts
src/interfaces/wallet.h
Before: src/interfaces/wallet.h · After: src/interfaces/wallet.h
File metadata
index 1cdff039b357ca45ec2fe0649f9b07e25ccb20e6..491aa530362aa8f43762af0446350e25623e6343 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. Before is on the left; after is on the right. Unified view fits narrow screens more easily.
src/interfaces/wallet.h
CHANGED
|
@@ -9,6 +9,7 @@
|
|
| 9 |
#include <common/signmessage.h>
|
| 10 |
#include <consensus/amount.h>
|
| 11 |
#include <interfaces/chain.h>
|
|
|
|
| 12 |
#include <pubkey.h>
|
| 13 |
#include <script/script.h>
|
| 14 |
#include <support/allocators/secure.h>
|
|
@@ -26,7 +27,6 @@
|
|
| 26 |
#include <utility>
|
| 27 |
#include <vector>
|
| 28 |
|
| 29 |
-
class CFeeRate;
|
| 30 |
class CKey;
|
| 31 |
enum class FeeReason;
|
| 32 |
enum class OutputType;
|
|
@@ -261,7 +261,8 @@ public:
|
|
| 261 |
virtual CoinsList listCoins() = 0;
|
| 262 |
|
| 263 |
//! Return wallet transaction output information.
|
| 264 |
-
virtual std::vector<WalletTxOut> getCoins(const std::vector<COutPoint>& outputs) = 0;
|
|
|
|
| 265 |
|
| 266 |
//! Get required fee.
|
| 267 |
virtual CAmount getRequiredFee(unsigned int tx_bytes) = 0;
|
|
@@ -451,10 +452,27 @@ struct WalletTxStatus
|
|
| 451 |
//! Wallet transaction output.
|
| 452 |
struct WalletTxOut
|
| 453 |
{
|
|
|
|
|
|
|
| 454 |
CTxOut txout;
|
|
|
|
| 455 |
int64_t time;
|
| 456 |
int depth_in_main_chain = -1;
|
| 457 |
bool is_spent = false;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 458 |
};
|
| 459 |
|
| 460 |
//! Migrated wallet info
|
|
|
|
| 9 |
#include <common/signmessage.h>
|
| 10 |
#include <consensus/amount.h>
|
| 11 |
#include <interfaces/chain.h>
|
| 12 |
+
#include <policy/feerate.h>
|
| 13 |
#include <pubkey.h>
|
| 14 |
#include <script/script.h>
|
| 15 |
#include <support/allocators/secure.h>
|
|
|
|
| 27 |
#include <utility>
|
| 28 |
#include <vector>
|
| 29 |
|
|
|
|
| 30 |
class CKey;
|
| 31 |
enum class FeeReason;
|
| 32 |
enum class OutputType;
|
|
|
|
| 261 |
virtual CoinsList listCoins() = 0;
|
| 262 |
|
| 263 |
//! Return wallet transaction output information.
|
| 264 |
+
virtual std::vector<WalletTxOut> getCoins(const std::vector<COutPoint>& outputs,
|
| 265 |
+
const std::optional<CFeeRate>& feerate = std::nullopt) = 0;
|
| 266 |
|
| 267 |
//! Get required fee.
|
| 268 |
virtual CAmount getRequiredFee(unsigned int tx_bytes) = 0;
|
|
|
|
| 452 |
//! Wallet transaction output.
|
| 453 |
struct WalletTxOut
|
| 454 |
{
|
| 455 |
+
//! Outpoint identifying this output in the wallet.
|
| 456 |
+
COutPoint outpoint;
|
| 457 |
CTxOut txout;
|
| 458 |
+
//! Wallet's smart transaction time for this output.
|
| 459 |
int64_t time;
|
| 460 |
int depth_in_main_chain = -1;
|
| 461 |
bool is_spent = false;
|
| 462 |
+
//! Wallet-owned facts used to present coin-control choices.
|
| 463 |
+
int input_bytes = -1;
|
| 464 |
+
std::optional<CAmount> effective_value;
|
| 465 |
+
CAmount ancestor_bump_fees{0};
|
| 466 |
+
bool is_spendable = false;
|
| 467 |
+
bool is_solvable = false;
|
| 468 |
+
bool is_safe = false;
|
| 469 |
+
bool is_locked = false;
|
| 470 |
+
bool is_reused = false;
|
| 471 |
+
bool is_immature = false;
|
| 472 |
+
bool is_change = false;
|
| 473 |
+
CTxDestination address;
|
| 474 |
+
CTxDestination grouping_address;
|
| 475 |
+
std::string label;
|
| 476 |
};
|
| 477 |
|
| 478 |
//! Migrated wallet info
|