87 for (
const auto& tx_out :
vout) {
89 throw std::runtime_error(std::string(__func__) +
": value out of range");
90 nValueOut += tx_out.nValue;
104 str +=
strprintf(
"CTransaction(hash=%s, ver=%d, vin.size=%u, vout.size=%u, nLockTime=%u)\n",
110 for (
const auto& tx_in :
vin)
111 str +=
" " + tx_in.ToString() +
"\n";
112 for (
const auto& tx_in :
vin)
113 str +=
" " + tx_in.scriptWitness.ToString() +
"\n";
114 for (
const auto& tx_out :
vout)
115 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
const uint256 & GetHash() const
CTransaction(const CMutableTransaction &tx)
Convert a CMutableTransaction into a CTransaction.
const std::vector< CTxOut > vout
uint256 ComputeHash() 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
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)
std::string HexStr(const Span< const uint8_t > s)
Convert a span of bytes to a lower-case hexadecimal string.
A mutable version of CTransaction.
uint256 GetHash() const
Compute the hash of this CMutableTransaction.
static const int PROTOCOL_VERSION
network protocol versioning