23 return strprintf(
"COutPoint(%s, %u)",
hash.ToString().substr(0,10),
n);
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.
unsigned int ComputeTotalSize() const
Calculate the total transaction size in bytes, including witness data.
bool ComputeHasWitness() const
CTransaction(const CMutableTransaction &tx)
Convert a CMutableTransaction into a CTransaction.
const Wtxid m_witness_hash
const std::vector< CTxOut > vout
std::string ToString() const
const bool m_has_witness
Memory only.
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.
static transaction_identifier FromUint256(const uint256 &id)
std::string HexStr(const std::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
A mutable version of CTransaction.
std::vector< CTxOut > vout
Txid GetHash() const
Compute the hash of this CMutableTransaction.
transaction_identifier< true > Wtxid
Wtxid commits to all transaction fields including the witness.
transaction_identifier< false > Txid
Txid commits to all transaction fields except the witness.