22 scriptSig = scriptSigIn;
23 nSequence = nSequenceIn;
29 scriptSig = scriptSigIn;
30 nSequence = nSequenceIn;
37 str += prevout.ToString();
42 if (nSequence != SEQUENCE_FINAL)
43 str +=
strprintf(
", nSequence=%u", nSequence);
51 scriptPubKey = scriptPubKeyIn;
56 return strprintf(
"CTxOut(nValue=%d.%08d, scriptPubKey=%s)", nValue /
COIN, nValue %
COIN,
HexStr(scriptPubKey).substr(0, 30));
86 for (
const auto& tx_out :
vout) {
88 throw std::runtime_error(std::string(__func__) +
": value out of range");
89 nValueOut += tx_out.nValue;
103 str +=
strprintf(
"CTransaction(hash=%s, ver=%d, vin.size=%u, vout.size=%u, nLockTime=%u)\n",
109 for (
const auto& tx_in :
vin)
110 str +=
" " + tx_in.ToString() +
"\n";
111 for (
const auto& tx_in : vin)
112 str +=
" " + tx_in.scriptWitness.ToString() +
"\n";
113 for (
const auto& tx_out :
vout)
114 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 CAmount COIN
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)
uint256 SerializeHash(const T &obj, int nType=SER_GETHASH, int nVersion=PROTOCOL_VERSION)
Compute the 256-bit hash of an object's serialization.
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.
std::vector< CTxOut > vout
const uint256 m_witness_hash
std::string HexStr(const Span< const uint8_t > s)
Convert a span of bytes to a lower-case hexadecimal string.
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.