Remove GetSerializeHash() method.

This commit is contained in:
Simon 2016-07-29 23:28:34 -07:00
parent c63af91a78
commit 74cd8821c7
2 changed files with 5 additions and 18 deletions

View File

@ -116,11 +116,6 @@ CMutableTransaction::CMutableTransaction(const CTransaction& tx) : nVersion(tx.n
} }
uint256 CMutableTransaction::GetSerializeHash() const
{
return SerializeHash(*this);
}
void CTransaction::UpdateHash() const void CTransaction::UpdateHash() const
{ {
*const_cast<uint256*>(&hash) = SerializeHash(*this); *const_cast<uint256*>(&hash) = SerializeHash(*this);
@ -214,8 +209,8 @@ std::string CTransaction::ToString() const
{ {
std::string str; std::string str;
str += strprintf("CTransaction(txid=%s, hash=%s, ver=%d, vin.size=%u, vout.size=%u, nLockTime=%u)\n", str += strprintf("CTransaction(txid=%s, hash=%s, ver=%d, vin.size=%u, vout.size=%u, nLockTime=%u)\n",
GetTxid().ToString().substr(0,10), txid.ToString().substr(0,10),
GetSerializeHash().ToString().substr(0,10), hash.ToString().substr(0,10),
nVersion, nVersion,
vin.size(), vin.size(),
vout.size(), vout.size(),
@ -245,8 +240,7 @@ void CTransaction::UpdateTxid() const
tx.joinSplitSig.assign(0); tx.joinSplitSig.assign(0);
} }
// Return double SHA256 hash *const_cast<uint256*>(&txid) = SerializeHash(tx);
*const_cast<uint256*>(&txid) = tx.GetSerializeHash();
} }
// Return a txid which is non-malleable. // Return a txid which is non-malleable.

View File

@ -343,10 +343,6 @@ public:
return vin.empty() && vout.empty(); return vin.empty() && vout.empty();
} }
const uint256& GetSerializeHash() const {
return hash;
}
// Return sum of txouts. // Return sum of txouts.
CAmount GetValueOut() const; CAmount GetValueOut() const;
// GetValueIn() is a method on CCoinsViewCache, because // GetValueIn() is a method on CCoinsViewCache, because
@ -416,12 +412,9 @@ struct CMutableTransaction
} }
} }
/** Compute the hash of this CMutableTransaction. This is computed on the /** Compute the non-malleable txid of this CMutableTransaction. This is computed on the
* fly, as opposed to GetSerializeHash() in CTransaction, which uses a cached result. * 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; uint256 GetTxid() const;
}; };