Changeset View
Changeset View
Standalone View
Standalone View
src/primitives/transaction.cpp
Show All 13 Lines | |||||
} | } | ||||
CTxIn::CTxIn(COutPoint prevoutIn, CScript scriptSigIn, uint32_t nSequenceIn) { | CTxIn::CTxIn(COutPoint prevoutIn, CScript scriptSigIn, uint32_t nSequenceIn) { | ||||
prevout = prevoutIn; | prevout = prevoutIn; | ||||
scriptSig = scriptSigIn; | scriptSig = scriptSigIn; | ||||
nSequence = nSequenceIn; | nSequence = nSequenceIn; | ||||
} | } | ||||
CTxIn::CTxIn(uint256 hashPrevTx, uint32_t nOut, CScript scriptSigIn, | CTxIn::CTxIn(TxHash hashPrevTx, uint32_t nOut, CScript scriptSigIn, | ||||
uint32_t nSequenceIn) { | uint32_t nSequenceIn) { | ||||
prevout = COutPoint(hashPrevTx, nOut); | prevout = COutPoint(hashPrevTx, nOut); | ||||
scriptSig = scriptSigIn; | scriptSig = scriptSigIn; | ||||
nSequence = nSequenceIn; | nSequence = nSequenceIn; | ||||
} | } | ||||
std::string CTxIn::ToString() const { | std::string CTxIn::ToString() const { | ||||
std::string str; | std::string str; | ||||
Show All 22 Lines | |||||
} | } | ||||
CMutableTransaction::CMutableTransaction() | CMutableTransaction::CMutableTransaction() | ||||
: nVersion(CTransaction::CURRENT_VERSION), nLockTime(0) {} | : nVersion(CTransaction::CURRENT_VERSION), nLockTime(0) {} | ||||
CMutableTransaction::CMutableTransaction(const CTransaction &tx) | CMutableTransaction::CMutableTransaction(const CTransaction &tx) | ||||
: nVersion(tx.nVersion), vin(tx.vin), vout(tx.vout), | : nVersion(tx.nVersion), vin(tx.vin), vout(tx.vout), | ||||
nLockTime(tx.nLockTime) {} | nLockTime(tx.nLockTime) {} | ||||
uint256 CMutableTransaction::GetId() const { | TxHash CMutableTransaction::GetId() const { | ||||
return SerializeHash(*this, SER_GETHASH, 0); | return SerializeHash(*this, SER_GETHASH, 0); | ||||
} | } | ||||
uint256 CTransaction::ComputeHash() const { | TxHash CTransaction::ComputeHash() const { | ||||
return SerializeHash(*this, SER_GETHASH, 0); | return SerializeHash(*this, SER_GETHASH, 0); | ||||
} | } | ||||
uint256 CTransaction::GetHash() const { | TxHash CTransaction::GetHash() const { | ||||
return GetId(); | return GetId(); | ||||
} | } | ||||
/** | /** | ||||
* For backward compatibility, the hash is initialized to 0. | * For backward compatibility, the hash is initialized to 0. | ||||
* TODO: remove the need for this default constructor entirely. | * TODO: remove the need for this default constructor entirely. | ||||
*/ | */ | ||||
CTransaction::CTransaction() | CTransaction::CTransaction() | ||||
▲ Show 20 Lines • Show All 66 Lines • Show Last 20 Lines |