aboutsummaryrefslogtreecommitdiff
path: root/src/wallet/spend.h
diff options
context:
space:
mode:
authorjosibake <josibake@protonmail.com>2022-07-29 10:01:25 +0200
committerjosibake <josibake@protonmail.com>2022-08-10 15:19:18 +0200
commit3f27a2adce12c6b0e7b43ba7c024331657bcf335 (patch)
tree3250e5e00118b849c23c76fd8677b5943420c6ae /src/wallet/spend.h
parentf5649db9d5e984ba7f376ccfd5b0a627f5c42402 (diff)
downloadbitcoin-3f27a2adce12c6b0e7b43ba7c024331657bcf335.tar.xz
refactor: add new helper methods
add Shuffle, Erase, and Add to CoinsResult struct add a helper function for mapping TxoutType to OutputType Co-authored-by: furszy <matiasfurszyfer@protonmail.com>
Diffstat (limited to 'src/wallet/spend.h')
-rw-r--r--src/wallet/spend.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/wallet/spend.h b/src/wallet/spend.h
index fdb5113ba4..dea5e7c65f 100644
--- a/src/wallet/spend.h
+++ b/src/wallet/spend.h
@@ -38,6 +38,7 @@ TxSize CalculateMaximumSignedTxSize(const CTransaction& tx, const CWallet* walle
* the CoinsResult struct as if it was a vector
*/
struct CoinsResult {
+ std::map<OutputType, std::vector<COutput>> coins;
/** Vectors for each OutputType */
std::vector<COutput> legacy;
std::vector<COutput> P2SH_segwit;
@@ -54,6 +55,9 @@ struct CoinsResult {
* i.e., methods can work with individual OutputType vectors or on the entire object */
uint64_t size() const;
void clear();
+ void Erase(std::set<COutPoint>& preset_coins);
+ void Shuffle(FastRandomContext& rng_fast);
+ void Add(OutputType type, const COutput& out);
/** Sum of all available coins */
CAmount total_amount{0};