21 scriptSig = scriptSigIn;
22 nSequence = nSequenceIn;
28 scriptSig = scriptSigIn;
29 nSequence = nSequenceIn;
36 str += prevout.ToString();
41 if (nSequence != SEQUENCE_FINAL)
42 str +=
strprintf(
", nSequence=%u", nSequence);
50 scriptPubKey = scriptPubKeyIn;
55 return strprintf(
"CTxOut(nValue=%d.%08d, scriptPubKey=%s)", nValue / COIN, nValue % COIN,
HexStr(scriptPubKey).substr(0, 30));
87 for (
const auto& tx_out :
vout) {
88 nValueOut += tx_out.nValue;
90 throw std::runtime_error(std::string(__func__) +
": value out of range");
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";
124 if(v.scriptPubKey.HasOpCreate() || v.scriptPubKey.HasOpCall()){
132 if(i.scriptSig.HasOpSpend()){
unsigned int GetTotalSize() const
Get the total transaction size in bytes, including witness data.
int64_t GetTransactionWeight(const CTransaction &tx)
uint256 ComputeHash() const
uint256 GetWitnessHash() const
size_t GetSerializeSize(const T &t, int nType, int nVersion=0)
bool MoneyRange(const CAmount &nValue)
std::string HexStr(const T itbegin, const T itend, bool fSpaces=false)
std::hash for asio::adress
const uint256 hash
Memory only.
std::string ToString() const
const std::vector< CTxIn > vin
std::string ToString() const
int64_t CAmount
Amount in lius (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.
An input of a transaction.
CAmount GetValueOut() const
const std::vector< CTxOut > vout
An output of a transaction.
An outpoint - a combination of a transaction hash and an index n into its vout.
std::vector< CTxOut > vout
std::string ToString() const
uint256 GetHash() const
Compute the hash of this CMutableTransaction.
std::string ToString() const
std::string ToString() const
Serialized script, used inside transaction inputs and outputs.
CTransaction()
Construct a CTransaction that qualifies as IsNull()
bool HasCreateOrCall() const
A mutable version of CTransaction.
const uint256 & GetHash() const
The basic transaction that is broadcasted on the network and contained in blocks. ...