Bitcoin Core 28.99.0
P2P Digital Currency
|
COutputs available for spending, stored by OutputType. More...
#include <spend.h>
Public Member Functions | |
std::vector< COutput > | All () const |
Concatenate and return all COutputs as one vector. More... | |
size_t | Size () const |
The following methods are provided so that CoinsResult can mimic a vector, i.e., methods can work with individual OutputType vectors or on the entire object. More... | |
size_t | TypesCount () const |
Return how many different output types this struct stores. More... | |
void | Clear () |
void | Erase (const std::unordered_set< COutPoint, SaltedOutpointHasher > &coins_to_remove) |
void | Shuffle (FastRandomContext &rng_fast) |
void | Add (OutputType type, const COutput &out) |
CAmount | GetTotalAmount () |
std::optional< CAmount > | GetEffectiveTotalAmount () |
Public Attributes | |
std::map< OutputType, std::vector< COutput > > | coins |
Private Attributes | |
CAmount | total_amount {0} |
Sum of all available coins raw value. More... | |
std::optional< CAmount > | total_effective_amount {0} |
Sum of all available coins effective value (each output value minus fees required to spend it) More... | |
COutputs available for spending, stored by OutputType.
This struct is really just a wrapper around OutputType vectors with a convenient method for concatenating and returning all COutputs as one vector.
Size(), Clear(), Erase(), Shuffle(), and Add() methods are implemented to allow easy interaction with the struct.
void wallet::CoinsResult::Add | ( | OutputType | type, |
const COutput & | out | ||
) |
std::vector< COutput > wallet::CoinsResult::All | ( | ) | const |
void wallet::CoinsResult::Clear | ( | ) |
void wallet::CoinsResult::Erase | ( | const std::unordered_set< COutPoint, SaltedOutpointHasher > & | coins_to_remove | ) |
|
inline |
|
inline |
void wallet::CoinsResult::Shuffle | ( | FastRandomContext & | rng_fast | ) |
size_t wallet::CoinsResult::Size | ( | ) | const |
The following methods are provided so that CoinsResult can mimic a vector, i.e., methods can work with individual OutputType vectors or on the entire object.
Definition at line 192 of file spend.cpp.
|
inline |
std::map<OutputType, std::vector<COutput> > wallet::CoinsResult::coins |
|
private |
|
private |