76 return std::any_of(
vin.begin(),
vin.end(), [](
const auto& input) {
77 return !input.scriptWitness.IsNull();
101 for (
const auto& tx_out :
vout) {
103 throw std::runtime_error(std::string(__func__) +
": value out of range");
104 nValueOut += tx_out.nValue;
118 str +=
strprintf(
"CTransaction(hash=%s, ver=%u, vin.size=%u, vout.size=%u, nLockTime=%u)\n",
124 for (
const auto& tx_in :
vin)
125 str +=
" " + tx_in.ToString() +
"\n";
126 for (
const auto& tx_in :
vin)
127 str +=
" " + tx_in.scriptWitness.ToString() +
"\n";
128 for (
const auto& tx_out :
vout)
129 str +=
" " + tx_out.ToString() +
"\n";
bool MoneyRange(const CAmount &nValue)
int64_t CAmount
Amount in satoshis (Can be negative)
static constexpr CAmount COIN
The amount of satoshis in one BTC.
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.
The basic transaction that is broadcasted on the network and contained in blocks.
bool ComputeHasWitness() const
CTransaction(const CMutableTransaction &tx)
Convert a CMutableTransaction into a CTransaction.
const std::vector< CTxOut > vout
std::string ToString() const
unsigned int GetTotalSize() const
Get the total transaction size in bytes, including witness data.
Wtxid ComputeWitnessHash() const
CAmount GetValueOut() const
const Txid & GetHash() const LIFETIMEBOUND
const std::vector< CTxIn > vin
static const uint32_t SEQUENCE_FINAL
Setting nSequence to this value for every input in a transaction disables nLockTime/IsFinalTx().
std::string ToString() const
std::string ToString() const
A writer stream (for serialization) that computes a 256-bit hash.
std::string ToString() const
const uint256 & ToUint256() const LIFETIMEBOUND
static transaction_identifier FromUint256(const uint256 &id)
std::string HexStr(const Span< const uint8_t > s)
Convert a span of bytes to a lower-case hexadecimal string.
static constexpr TransactionSerParams TX_NO_WITNESS
static constexpr TransactionSerParams TX_WITH_WITNESS
size_t GetSerializeSize(const T &t)
A mutable version of CTransaction.
Txid GetHash() const
Compute the hash of this CMutableTransaction.