7 #ifndef PIVX_PRIMITIVES_TRANSACTION_H
8 #define PIVX_PRIMITIVES_TRANSACTION_H
207 template<
typename Stream,
typename TxType>
217 if (tx.isSaplingVersion()) {
219 if (!tx.IsNormalType()) {
220 s >> tx.extraPayload;
225 template<
typename Stream,
typename TxType>
232 if (tx.isSaplingVersion()) {
234 if (!tx.IsNormalType()) {
235 s << tx.extraPayload;
287 template <
typename Stream>
294 template <
typename Stream>
298 return vin.empty() &&
vout.empty();
308 (!
sapData->vShieldedOutput.empty() ||
309 !
sapData->vShieldedSpend.empty() ||
378 return (
vin.size() == 1 &&
vin[0].prevout.IsNull() && !
vin[0].scriptSig.IsZerocoinSpend());
421 template <
typename Stream>
426 template <
typename Stream>
431 template <
typename Stream>
457 static inline CTransactionRef MakeTransactionRef() {
return std::make_shared<const CTransaction>(); }
458 template <
typename Tx>
static inline CTransactionRef MakeTransactionRef(Tx&& txIn) {
return std::make_shared<const CTransaction>(std::forward<Tx>(txIn)); }
463 template <
typename T>
469 }
catch (std::exception& e) {
474 template <
typename T>
479 template <
typename T>
485 template <
typename T>
int64_t CAmount
Amount in PIV (Can be negative)
An outpoint - a combination of a transaction hash and an index n into its vout.
std::string ToString() const
friend bool operator==(const BaseOutPoint &a, const BaseOutPoint &b)
friend bool operator!=(const BaseOutPoint &a, const BaseOutPoint &b)
BaseOutPoint(const uint256 &hashIn, const uint32_t nIn, bool isTransparentIn=true)
friend bool operator<(const BaseOutPoint &a, const BaseOutPoint &b)
std::string ToStringShort() const
SERIALIZE_METHODS(BaseOutPoint, obj)
size_t DynamicMemoryUsage() const
const_iterator end() const
const_iterator begin() const
An outpoint - a combination of a transaction hash and an index n into its vout.
COutPoint(const uint256 &hashIn, const uint32_t nIn)
std::string ToString() const
Serialized script, used inside transaction inputs and outputs.
size_t DynamicMemoryUsage() const
The basic transaction that is broadcasted on the network and contained in blocks.
friend bool operator==(const CTransaction &a, const CTransaction &b)
bool IsNormalType() const
bool HasZerocoinSpendInputs() const
CTransaction()
Construct a CTransaction that qualifies as IsNull()
bool HasExchangeAddr() const
bool IsQuorumCommitmentTx() const
CTransaction(deserialize_type, Stream &s)
This deserializing constructor is provided instead of an Unserialize method.
bool IsShieldedTx() const
bool hasExtraPayload() const
bool HasZerocoinMintOutputs() const
bool ContainsZerocoins() const
SigVersion GetRequiredSigVersion() const
void Serialize(Stream &s) const
size_t DynamicMemoryUsage() const
TxVersion
Transaction Versions.
uint256 ComputeHash() const
const uint256 & GetHash() const
std::string ToString() const
CAmount GetShieldedValueIn() const
Optional< std::vector< uint8_t > > extraPayload
unsigned int GetTotalSize() const
CAmount GetValueOut() const
Optional< SaplingTxData > sapData
bool HasP2CSOutputs() const
bool isSaplingVersion() const
friend bool operator!=(const CTransaction &a, const CTransaction &b)
std::vector< CTxOut > vout
static const int16_t CURRENT_VERSION
const uint256 hash
Memory only.
CTransaction(const CTransaction &tx)=default
bool hasSaplingData() const
An input of a transaction.
friend bool operator==(const CTxIn &a, const CTxIn &b)
bool IsZerocoinSpend() const
friend bool operator!=(const CTxIn &a, const CTxIn &b)
size_t DynamicMemoryUsage() const
static const uint32_t SEQUENCE_FINAL
bool IsZerocoinPublicSpend() const
std::string ToString() const
SERIALIZE_METHODS(CTxIn, obj)
An output of a transaction.
SERIALIZE_METHODS(CTxOut, obj)
friend bool operator==(const CTxOut &a, const CTxOut &b)
bool IsZerocoinMint() const
friend bool operator!=(const CTxOut &a, const CTxOut &b)
size_t DynamicMemoryUsage() const
std::string ToString() const
An outpoint - a combination of a transaction hash and an index n into its sapling output description ...
SaplingOutPoint(const uint256 &hashIn, const uint32_t nIn)
std::string ToString() const
#define T(expected, seed, data)
boost::optional< T > Optional
Substitute for C++17 std::optional.
constexpr deserialize_type deserialize
A mutable version of CTransaction.
bool IsNormalType() const
Optional< std::vector< uint8_t > > extraPayload
Optional< SaplingTxData > sapData
uint256 GetHash() const
Compute the hash of this CMutableTransaction.
void Unserialize(Stream &s)
bool hasExtraPayload() const
void Serialize(Stream &s) const
SigVersion GetRequiredSigVersion() const
CMutableTransaction(deserialize_type, Stream &s)
std::vector< CTxOut > vout
bool isSaplingVersion() const
Dummy data type to identify deserializing constructors.
void UnserializeTransaction(TxType &tx, Stream &s)
Transaction serialization format:
void SetTxPayload(CMutableTransaction &tx, const T &payload)
void SerializeTransaction(const TxType &tx, Stream &s)
bool GetTxPayload(const std::vector< unsigned char > &payload, T &obj)
std::shared_ptr< const CTransaction > CTransactionRef