Optimize GetWitnessHash() for non-segwit transactions

Github-Pull: #9912
Rebased-From: 02c57b521a
This commit is contained in:
Suhas Daftuar 2017-03-03 13:33:32 -05:00 committed by MarcoFalke
parent e9611d10b6
commit fc3d7db580

View file

@ -69,6 +69,9 @@ uint256 CTransaction::ComputeHash() const
uint256 CTransaction::GetWitnessHash() const
{
if (!HasWitness()) {
return GetHash();
}
return SerializeHash(*this, SER_GETHASH, 0);
}