diff --git a/src/primitives/transaction.cpp b/src/primitives/transaction.cpp index 2fbaad854..854a0be66 100644 --- a/src/primitives/transaction.cpp +++ b/src/primitives/transaction.cpp @@ -116,11 +116,6 @@ CMutableTransaction::CMutableTransaction(const CTransaction& tx) : nVersion(tx.n } -uint256 CMutableTransaction::GetSerializeHash() const -{ - return SerializeHash(*this); -} - void CTransaction::UpdateHash() const { *const_cast(&hash) = SerializeHash(*this); @@ -214,8 +209,8 @@ std::string CTransaction::ToString() const { std::string str; str += strprintf("CTransaction(txid=%s, hash=%s, ver=%d, vin.size=%u, vout.size=%u, nLockTime=%u)\n", - GetTxid().ToString().substr(0,10), - GetSerializeHash().ToString().substr(0,10), + txid.ToString().substr(0,10), + hash.ToString().substr(0,10), nVersion, vin.size(), vout.size(), @@ -245,8 +240,7 @@ void CTransaction::UpdateTxid() const tx.joinSplitSig.assign(0); } - // Return double SHA256 hash - *const_cast(&txid) = tx.GetSerializeHash(); + *const_cast(&txid) = SerializeHash(tx); } // Return a txid which is non-malleable. diff --git a/src/primitives/transaction.h b/src/primitives/transaction.h index 69d209e0d..ecfe40d10 100644 --- a/src/primitives/transaction.h +++ b/src/primitives/transaction.h @@ -343,10 +343,6 @@ public: return vin.empty() && vout.empty(); } - const uint256& GetSerializeHash() const { - return hash; - } - // Return sum of txouts. CAmount GetValueOut() const; // GetValueIn() is a method on CCoinsViewCache, because @@ -416,12 +412,9 @@ struct CMutableTransaction } } - /** Compute the hash of this CMutableTransaction. This is computed on the - * fly, as opposed to GetSerializeHash() in CTransaction, which uses a cached result. + /** Compute the non-malleable txid of this CMutableTransaction. This is computed on the + * fly, as opposed to GetTxid() in CTransaction, which uses a cached result. */ - uint256 GetSerializeHash() const; - - // Compute a non-malleable txid on the fly. uint256 GetTxid() const; };