veriblock-pop-cpp
C++11 Libraries for leveraging VeriBlock Proof-Of-Proof blockchain technology.
altintegration::btc::Transaction Struct Reference

The basic transaction that is broadcasted on the network and contained in blocks. More...

Detailed Description

A transaction can contain multiple inputs and outputs.

Definition at line 98 of file transaction.hpp.

#include <transaction.hpp>

+ Collaboration diagram for altintegration::btc::Transaction:

Public Member Functions

template<typename Stream >
void Serialize (Stream &s) const
 
template<typename Stream >
void Unserialize (Stream &s)
 
bool HasWitness () const
 

Public Attributes

std::vector< TxInvin
 
std::vector< TxOutvout
 
int32_t nVersion
 
uint32_t nLockTime
 

Friends

bool operator== (const Transaction &a, const Transaction &b)
 
bool operator!= (const Transaction &a, const Transaction &b)
 

Member Function Documentation

◆ HasWitness()

bool altintegration::btc::Transaction::HasWitness ( ) const
inline

Definition at line 128 of file transaction.hpp.

128 {
129 for (size_t i = 0; i < vin.size(); i++) {
130 if (!vin[i].scriptWitness.empty()) {
131 return true;
132 }
133 }
134 return false;
135 }

◆ Serialize()

template<typename Stream >
void altintegration::btc::Transaction::Serialize ( Stream &  s) const
inline

Definition at line 110 of file transaction.hpp.

110 {
111 SerializeTransaction(*this, s);
112 }

◆ Unserialize()

template<typename Stream >
void altintegration::btc::Transaction::Unserialize ( Stream &  s)
inline

Definition at line 115 of file transaction.hpp.

115 {
116 UnserializeTransaction(*this, s);
117 }

Friends And Related Function Documentation

◆ operator!=

bool operator!= ( const Transaction a,
const Transaction b 
)
friend

Definition at line 124 of file transaction.hpp.

124 {
125 return !(a == b);
126 }

◆ operator==

bool operator== ( const Transaction a,
const Transaction b 
)
friend

Definition at line 119 of file transaction.hpp.

119 {
120 return a.vin == b.vin && a.vout == b.vout && a.nVersion == b.nVersion &&
121 a.nLockTime == b.nLockTime;
122 }

Member Data Documentation

◆ nLockTime

uint32_t altintegration::btc::Transaction::nLockTime

Definition at line 107 of file transaction.hpp.

◆ nVersion

int32_t altintegration::btc::Transaction::nVersion

Definition at line 106 of file transaction.hpp.

◆ vin

std::vector<TxIn> altintegration::btc::Transaction::vin

Definition at line 104 of file transaction.hpp.

◆ vout

std::vector<TxOut> altintegration::btc::Transaction::vout

Definition at line 105 of file transaction.hpp.


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