92 for (
const auto& tx_out :
vout) {
94 throw std::runtime_error(std::string(__func__) +
": value out of range");
95 nValueOut += tx_out.nValue;
109 str +=
strprintf(
"CTransaction(hash=%s, ver=%d, vin.size=%u, vout.size=%u, nLockTime=%u)\n",
115 for (
const auto& tx_in :
vin)
116 str +=
" " + tx_in.ToString() +
"\n";
117 for (
const auto& tx_in :
vin)
118 str +=
" " + tx_in.scriptWitness.ToString() +
"\n";
119 for (
const auto& tx_out :
vout)
120 str +=
" " + tx_out.ToString() +
"\n";
static const int SERIALIZE_TRANSACTION_NO_WITNESS
A flag that is ORed into the protocol version to designate that a transaction should be (un)serialize...
static const uint32_t SEQUENCE_FINAL
Setting nSequence to this value for every input in a transaction disables nLockTime/IsFinalTx().
bool MoneyRange(const CAmount &nValue)
std::string ToString() const
std::string ToString() const
std::string ToString() const
const uint256 hash
Memory only.
const std::vector< CTxIn > vin
CAmount GetValueOut() const
size_t GetSerializeSize(const T &t, int nVersion=0)
int64_t CAmount
Amount in satoshis (Can be negative)
std::string HexStr(const Span< const uint8_t > s)
Convert a span of bytes to a lower-case hexadecimal string.
const uint256 & GetHash() const
const std::vector< CTxOut > vout
std::string ToString() const
An outpoint - a combination of a transaction hash and an index n into its vout.
uint256 ComputeHash() const
uint256 ComputeWitnessHash() const
uint256 GetHash() const
Compute the hash of this CMutableTransaction.
Serialized script, used inside transaction inputs and outputs.
static const int PROTOCOL_VERSION
network protocol versioning
std::string ToString() const
A mutable version of CTransaction.
unsigned int GetTotalSize() const
Get the total transaction size in bytes, including witness data.
The basic transaction that is broadcasted on the network and contained in blocks. ...
CTransaction(const CMutableTransaction &tx)
Convert a CMutableTransaction into a CTransaction.
static constexpr CAmount COIN
The amount of satoshis in one BTC.