Merge #9912: Optimize GetWitnessHash() for non-segwit transactions

02c57b5 Optimize GetWitnessHash() for non-segwit transactions (Suhas Daftuar)

Tree-SHA512: 405d07c11930f3432ae25b11232466a30ba2339be98e0fb5149934d792e014f504fedbe62b9c8e5febbbdad459bd1573ea896e527b9aa591926bbc774b895e6a
This commit is contained in:
Wladimir J. van der Laan 2017-03-07 11:03:16 +01:00
commit 6015df5b85
No known key found for this signature in database
GPG Key ID: 74810B012346C9A6
1 changed files with 3 additions and 0 deletions

View File

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