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";
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.
uint256 ComputeWitnessHash() const
CTransaction(const CMutableTransaction &tx)
Convert a CMutableTransaction into a CTransaction.
const std::vector< CTxOut > vout
uint256 ComputeHash() const
const uint256 & GetHash() const
std::string ToString() const
unsigned int GetTotalSize() const
Get the total transaction size in bytes, including witness data.
CAmount GetValueOut() const
const std::vector< CTxIn > vin
const uint256 hash
Memory only.
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
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.
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...
size_t GetSerializeSize(const T &t, int nVersion=0)
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.
static const int PROTOCOL_VERSION
network protocol versioning