wallet::CoinsResult

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.

Synopsis

Declared in <wallet/spend.h>

struct CoinsResult;

Description

Size(), Erase(), Shuffle(), and Add() methods are implemented to allow easy interaction with the struct.

Member Functions

NameDescription
Add Add a single output of the given type to the result.
All Concatenate and return all COutputs as one vector
Erase Remove the given outpoints from the stored coins.
GetAppropriateTotal Returns the appropriate total based on whether fees are being subtracted from outputs.
GetEffectiveTotalAmount Return the sum of the effective value of all available coins, if known.
GetTotalAmount Return the sum of the raw value of all available coins.
Shuffle Randomly shuffle the stored coins.
Size 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
TypesCount Return how many different output types this struct stores

Data Members

NameDescription
coins Available outputs grouped by their output type.

Non-Member Functions

NameDescription
AvailableCoinsPopulate the CoinsResult struct with vectors of available COutputs, organized by OutputType.
FetchSelectedInputsFetch and validate coin control selected inputs. Coins could be internal (from the wallet) or external.