65 if (
nSequence != std::numeric_limits<unsigned int>::max())
108 return memusage::RecursiveDynamicUsage(
vin) + memusage::RecursiveDynamicUsage(
vout);
119 if (txin.IsZerocoinSpend() || txin.IsZerocoinPublicSpend())
128 if (txout.IsZerocoinMint())
139 bool fAllowNull =
vin[0].IsZerocoinSpend();
140 if (
vin[0].prevout.IsNull() && !fAllowNull)
143 return (
vout.size() >= 2 &&
vout[0].IsEmpty());
148 return std::any_of(
vout.begin(),
vout.end(), [](
const auto& txout) { return txout.scriptPubKey.IsPayToExchangeAddress(); });
154 if (txout.scriptPubKey.IsPayToColdStaking())
166 throw std::runtime_error(
"CTransaction::GetValueOut() : value out of range : less than 0");
168 if (nValueOut + out.nValue < nValueOut)
169 throw std::runtime_error(
"CTransaction::GetValueOut() : value out of range : wraps the int64_t boundary");
171 nValueOut += out.nValue;
177 nValueOut += -
sapData->valueBalance;
181 throw std::runtime_error(
"GetValueOut(): invalid tx version");
193 nValue +=
sapData->valueBalance;
197 throw std::runtime_error(
"GetValueOut(): invalid tx version");
210 std::ostringstream ss;
213 <<
", type=" <<
nType
214 <<
", vin.size=" <<
vin.size()
215 <<
", vout.size=" <<
vout.size()
218 ss <<
", valueBalance=" <<
sapData->valueBalance
219 <<
", vShieldedSpend.size=" <<
sapData->vShieldedSpend.size()
220 <<
", vShieldedOutput.size=" <<
sapData->vShieldedOutput.size();
226 for (
const auto& in :
vin)
227 ss <<
" " << in.ToString() <<
"\n";
228 for (
const auto& out :
vout)
229 ss <<
" " << out.ToString() <<
"\n";
int64_t CAmount
Amount in PIV (Can be negative)
std::string ToStringShort() const
An outpoint - a combination of a transaction hash and an index n into its vout.
std::string ToString() const
Serialized script, used inside transaction inputs and outputs.
bool IsZerocoinSpend() const
bool IsZerocoinPublicSpend() const
bool IsZerocoinMint() const
The basic transaction that is broadcasted on the network and contained in blocks.
bool HasZerocoinSpendInputs() const
CTransaction()
Construct a CTransaction that qualifies as IsNull()
bool HasExchangeAddr() const
bool IsShieldedTx() const
bool HasZerocoinMintOutputs() const
size_t DynamicMemoryUsage() const
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
std::vector< CTxOut > vout
bool hasSaplingData() const
An input of a transaction.
bool IsZerocoinSpend() const
bool IsZerocoinPublicSpend() const
std::string ToString() const
An output of a transaction.
bool IsZerocoinMint() const
std::string ToString() const
std::string ToString() const
std::string ToString() const
uint256 SerializeHash(const T &obj, int nType=SER_GETHASH, int nVersion=PROTOCOL_VERSION)
Compute the 256-bit hash of an object's serialization.
unsigned int GetSerializeSize(const std::array< T, N > &item)
array
A mutable version of CTransaction.
uint256 GetHash() const
Compute the hash of this CMutableTransaction.
std::string HexStr(const Span< const uint8_t > s)
Convert a span of bytes to a lower-case hexadecimal string.