Bitcoin Core  24.99.0
P2P Digital Currency
Public Member Functions | Public Attributes | List of all members
wallet::CoinsResult Struct Reference

COutputs available for spending, stored by OutputType. More...

#include <spend.h>

Public Member Functions

std::vector< COutputAll () 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...
 
void Clear ()
 
void Erase (std::set< COutPoint > &preset_coins)
 
void Shuffle (FastRandomContext &rng_fast)
 
void Add (OutputType type, const COutput &out)
 

Public Attributes

std::map< OutputType, std::vector< COutput > > coins
 
CAmount total_amount {0}
 Sum of all available coins. More...
 

Detailed Description

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.

Definition at line 40 of file spend.h.

Member Function Documentation

◆ Add()

void wallet::CoinsResult::Add ( OutputType  type,
const COutput out 
)

Definition at line 124 of file spend.cpp.

Here is the caller graph for this function:

◆ All()

std::vector< COutput > wallet::CoinsResult::All ( ) const

Concatenate and return all COutputs as one vector.

Definition at line 91 of file spend.cpp.

Here is the caller graph for this function:

◆ Clear()

void wallet::CoinsResult::Clear ( )

Definition at line 101 of file spend.cpp.

Here is the caller graph for this function:

◆ Erase()

void wallet::CoinsResult::Erase ( std::set< COutPoint > &  preset_coins)

Definition at line 105 of file spend.cpp.

Here is the caller graph for this function:

◆ Shuffle()

void wallet::CoinsResult::Shuffle ( FastRandomContext rng_fast)

Definition at line 117 of file spend.cpp.

Here is the caller graph for this function:

◆ Size()

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 82 of file spend.cpp.

Here is the caller graph for this function:

Member Data Documentation

◆ coins

std::map<OutputType, std::vector<COutput> > wallet::CoinsResult::coins

Definition at line 41 of file spend.h.

◆ total_amount

CAmount wallet::CoinsResult::total_amount {0}

Sum of all available coins.

Definition at line 55 of file spend.h.


The documentation for this struct was generated from the following files: