Bitcoin Core 28.99.0
P2P Digital Currency
Public Member Functions | Static Public Member Functions | Private Member Functions | Private Attributes | List of all members
transaction_identifier< has_witness > Class Template Reference

transaction_identifier represents the two canonical transaction identifier types (txid, wtxid). More...

#include <transaction_identifier.h>

Collaboration diagram for transaction_identifier< has_witness >:
[legend]

Public Member Functions

 transaction_identifier ()
 
template<typename Other >
bool operator== (const Other &other) const
 
template<typename Other >
bool operator!= (const Other &other) const
 
template<typename Other >
bool operator< (const Other &other) const
 
const uint256ToUint256 () const LIFETIMEBOUND
 
constexpr bool IsNull () const
 Wrapped uint256 methods. More...
 
constexpr void SetNull ()
 
std::string GetHex () const
 
std::string ToString () const
 
constexpr const std::byte * data () const
 
constexpr const std::byte * begin () const
 
constexpr const std::byte * end () const
 
template<typename Stream >
void Serialize (Stream &s) const
 
template<typename Stream >
void Unserialize (Stream &s)
 
 operator const uint256 & () const LIFETIMEBOUND
 Conversion function to uint256. More...
 

Static Public Member Functions

static transaction_identifier FromUint256 (const uint256 &id)
 
static std::optional< transaction_identifierFromHex (std::string_view hex)
 
static constexpr auto size ()
 

Private Member Functions

 transaction_identifier (const uint256 &wrapped)
 
constexpr int Compare (const uint256 &other) const
 
constexpr int Compare (const transaction_identifier< has_witness > &other) const
 
template<typename Other >
constexpr int Compare (const Other &other) const
 

Private Attributes

uint256 m_wrapped
 

Detailed Description

template<bool has_witness>
class transaction_identifier< has_witness >

transaction_identifier represents the two canonical transaction identifier types (txid, wtxid).

Definition at line 11 of file transaction_identifier.h.

Constructor & Destructor Documentation

◆ transaction_identifier() [1/2]

template<bool has_witness>
transaction_identifier< has_witness >::transaction_identifier ( const uint256 wrapped)
inlineprivate

Definition at line 16 of file transaction_identifier.h.

◆ transaction_identifier() [2/2]

template<bool has_witness>
transaction_identifier< has_witness >::transaction_identifier ( )
inline

Definition at line 30 of file transaction_identifier.h.

Member Function Documentation

◆ begin()

template<bool has_witness>
constexpr const std::byte * transaction_identifier< has_witness >::begin ( ) const
inlineconstexpr

Definition at line 55 of file transaction_identifier.h.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ Compare() [1/3]

template<bool has_witness>
template<typename Other >
constexpr int transaction_identifier< has_witness >::Compare ( const Other &  other) const
inlineconstexprprivate

Definition at line 23 of file transaction_identifier.h.

◆ Compare() [2/3]

template<bool has_witness>
constexpr int transaction_identifier< has_witness >::Compare ( const transaction_identifier< has_witness > &  other) const
inlineconstexprprivate

Definition at line 21 of file transaction_identifier.h.

Here is the call graph for this function:

◆ Compare() [3/3]

template<bool has_witness>
constexpr int transaction_identifier< has_witness >::Compare ( const uint256 other) const
inlineconstexprprivate

Definition at line 20 of file transaction_identifier.h.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ data()

template<bool has_witness>
constexpr const std::byte * transaction_identifier< has_witness >::data ( ) const
inlineconstexpr

Definition at line 54 of file transaction_identifier.h.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ end()

template<bool has_witness>
constexpr const std::byte * transaction_identifier< has_witness >::end ( ) const
inlineconstexpr

Definition at line 56 of file transaction_identifier.h.

Here is the call graph for this function:

◆ FromHex()

template<bool has_witness>
static std::optional< transaction_identifier > transaction_identifier< has_witness >::FromHex ( std::string_view  hex)
inlinestatic

Definition at line 45 of file transaction_identifier.h.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ FromUint256()

template<bool has_witness>
static transaction_identifier transaction_identifier< has_witness >::FromUint256 ( const uint256 id)
inlinestatic

Definition at line 40 of file transaction_identifier.h.

Here is the caller graph for this function:

◆ GetHex()

template<bool has_witness>
std::string transaction_identifier< has_witness >::GetHex ( ) const
inline

Definition at line 51 of file transaction_identifier.h.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ IsNull()

template<bool has_witness>
constexpr bool transaction_identifier< has_witness >::IsNull ( ) const
inlineconstexpr

Wrapped uint256 methods.

Definition at line 43 of file transaction_identifier.h.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ operator const uint256 &()

template<bool has_witness>
transaction_identifier< has_witness >::operator const uint256 & ( ) const
inline

Conversion function to uint256.

Note: new code should use ToUint256.

TODO: This should be removed once the majority of the code has switched to using the Txid and Wtxid types. Until then it makes for a smoother transition to allow this conversion.

Definition at line 67 of file transaction_identifier.h.

◆ operator!=()

template<bool has_witness>
template<typename Other >
bool transaction_identifier< has_witness >::operator!= ( const Other &  other) const
inline

Definition at line 35 of file transaction_identifier.h.

Here is the call graph for this function:

◆ operator<()

template<bool has_witness>
template<typename Other >
bool transaction_identifier< has_witness >::operator< ( const Other &  other) const
inline

Definition at line 37 of file transaction_identifier.h.

Here is the call graph for this function:

◆ operator==()

template<bool has_witness>
template<typename Other >
bool transaction_identifier< has_witness >::operator== ( const Other &  other) const
inline

Definition at line 33 of file transaction_identifier.h.

Here is the call graph for this function:

◆ Serialize()

template<bool has_witness>
template<typename Stream >
void transaction_identifier< has_witness >::Serialize ( Stream &  s) const
inline

Definition at line 57 of file transaction_identifier.h.

Here is the call graph for this function:

◆ SetNull()

template<bool has_witness>
constexpr void transaction_identifier< has_witness >::SetNull ( )
inlineconstexpr

Definition at line 44 of file transaction_identifier.h.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ size()

template<bool has_witness>
static constexpr auto transaction_identifier< has_witness >::size ( )
inlinestaticconstexpr

Definition at line 53 of file transaction_identifier.h.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ ToString()

template<bool has_witness>
std::string transaction_identifier< has_witness >::ToString ( ) const
inline

Definition at line 52 of file transaction_identifier.h.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ ToUint256()

template<bool has_witness>
const uint256 & transaction_identifier< has_witness >::ToUint256 ( ) const
inline

Definition at line 39 of file transaction_identifier.h.

Here is the caller graph for this function:

◆ Unserialize()

template<bool has_witness>
template<typename Stream >
void transaction_identifier< has_witness >::Unserialize ( Stream &  s)
inline

Definition at line 58 of file transaction_identifier.h.

Here is the call graph for this function:

Member Data Documentation

◆ m_wrapped

template<bool has_witness>
uint256 transaction_identifier< has_witness >::m_wrapped
private

Definition at line 13 of file transaction_identifier.h.


The documentation for this class was generated from the following file: