diff options
author | MarcoFalke <*~=`'#}+{/-|&$^_@721217.xyz> | 2023-09-11 15:47:52 +0200 |
---|---|---|
committer | MarcoFalke <*~=`'#}+{/-|&$^_@721217.xyz> | 2023-09-19 16:38:08 +0200 |
commit | fa72f09d6ff8ee204f331a69d3f5e825223c9e11 (patch) | |
tree | d45356514481c7a21d7fe4c87681a85bfdd86347 /src/primitives/transaction.cpp | |
parent | fa4a9c0f4334678fb80358ead667807bf2a0a153 (diff) |
Remove CHashWriter type
The type is only ever set, but never read via GetType(), so remove it.
Also, remove SerializeHash to avoid silent merge conflicts and use the
already existing GetHash() boilerplate consistently.
Diffstat (limited to 'src/primitives/transaction.cpp')
-rw-r--r-- | src/primitives/transaction.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/primitives/transaction.cpp b/src/primitives/transaction.cpp index 3060746909..2c913bf432 100644 --- a/src/primitives/transaction.cpp +++ b/src/primitives/transaction.cpp @@ -67,12 +67,12 @@ CMutableTransaction::CMutableTransaction(const CTransaction& tx) : vin(tx.vin), uint256 CMutableTransaction::GetHash() const { - return SerializeHash(*this, SER_GETHASH, SERIALIZE_TRANSACTION_NO_WITNESS); + return (CHashWriter{SERIALIZE_TRANSACTION_NO_WITNESS} << *this).GetHash(); } uint256 CTransaction::ComputeHash() const { - return SerializeHash(*this, SER_GETHASH, SERIALIZE_TRANSACTION_NO_WITNESS); + return (CHashWriter{SERIALIZE_TRANSACTION_NO_WITNESS} << *this).GetHash(); } uint256 CTransaction::ComputeWitnessHash() const @@ -80,7 +80,7 @@ uint256 CTransaction::ComputeWitnessHash() const if (!HasWitness()) { return hash; } - return SerializeHash(*this, SER_GETHASH, 0); + return (CHashWriter{0} << *this).GetHash(); } CTransaction::CTransaction(const CMutableTransaction& tx) : vin(tx.vin), vout(tx.vout), nVersion(tx.nVersion), nLockTime(tx.nLockTime), hash{ComputeHash()}, m_witness_hash{ComputeWitnessHash()} {} |