Changeset View
Changeset View
Standalone View
Standalone View
src/primitives/transaction.cpp
Show First 20 Lines • Show All 54 Lines • ▼ Show 20 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 { | static uint256 ComputeCMutableTransactionHash(const CMutableTransaction &tx) { | ||||
return SerializeHash(*this, SER_GETHASH, 0); | return SerializeHash(tx, SER_GETHASH, 0); | ||||
} | } | ||||
uint256 CTransaction::ComputeHash() const { | TxId CMutableTransaction::GetId() const { | ||||
return SerializeHash(*this, SER_GETHASH, 0); | return TxId(ComputeCMutableTransactionHash(*this)); | ||||
} | } | ||||
uint256 CTransaction::GetHash() const { | TxHash CMutableTransaction::GetHash() const { | ||||
return GetId(); | return TxHash(ComputeCMutableTransactionHash(*this)); | ||||
} | |||||
uint256 CTransaction::ComputeHash() const { | |||||
return SerializeHash(*this, SER_GETHASH, 0); | |||||
} | } | ||||
/** | /** | ||||
* 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() | ||||
: nVersion(CTransaction::CURRENT_VERSION), vin(), vout(), nLockTime(0), | : nVersion(CTransaction::CURRENT_VERSION), vin(), vout(), nLockTime(0), | ||||
▲ Show 20 Lines • Show All 65 Lines • Show Last 20 Lines |