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

Bitcoin transaction representation. More...

Detailed Description

Definition at line 29 of file btctx.hpp.

#include <btctx.hpp>

+ Collaboration diagram for altintegration::BtcTx:

Public Types

using hash_t = uint256
 

Public Member Functions

 BtcTx (std::vector< uint8_t > bytes)
 
 BtcTx (Slice< const uint8_t > slice)
 
void toVbkEncoding (WriteStream &stream) const
 Convert BtcTx to data stream using BtcTx VBK byte format. More...
 
void toRaw (WriteStream &stream) const
 Convert BtcTx to data stream using BtcTx basic byte format. More...
 
size_t estimateSize () const
 
hash_t getHash () const
 Calculate the hash of the btc transaction. More...
 

Public Attributes

std::vector< uint8_t > tx {}
 

Friends

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

Member Typedef Documentation

◆ hash_t

Definition at line 30 of file btctx.hpp.

Constructor & Destructor Documentation

◆ BtcTx() [1/2]

altintegration::BtcTx::BtcTx ( std::vector< uint8_t >  bytes)
inline

Definition at line 34 of file btctx.hpp.

34: tx(std::move(bytes)) {}

◆ BtcTx() [2/2]

altintegration::BtcTx::BtcTx ( Slice< const uint8_t >  slice)
inline

Definition at line 35 of file btctx.hpp.

35: tx(slice.begin(), slice.end()) {}

Member Function Documentation

◆ getHash()

hash_t altintegration::BtcTx::getHash ( ) const
Returns
hash transaction hash

◆ toRaw()

void altintegration::BtcTx::toRaw ( WriteStream stream) const
Parameters
streamdata stream to write into

◆ toVbkEncoding()

void altintegration::BtcTx::toVbkEncoding ( WriteStream stream) const
Parameters
streamdata stream to write into

Friends And Related Function Documentation

◆ operator!=

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

Definition at line 41 of file btctx.hpp.

41 {
42 return !(a.tx == b.tx);
43 }

◆ operator==

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

Definition at line 37 of file btctx.hpp.

37 {
38 return a.tx == b.tx;
39 }

Member Data Documentation

◆ tx

std::vector<uint8_t> altintegration::BtcTx::tx {}

Definition at line 31 of file btctx.hpp.


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