Optimize GetWitnessHash() for non-segwit transactions
This commit is contained in:
parent
d19d45a1e6
commit
02c57b521a
1 changed files with 3 additions and 0 deletions
|
@ -69,6 +69,9 @@ uint256 CTransaction::ComputeHash() const
|
|||
|
||||
uint256 CTransaction::GetWitnessHash() const
|
||||
{
|
||||
if (!HasWitness()) {
|
||||
return GetHash();
|
||||
}
|
||||
return SerializeHash(*this, SER_GETHASH, 0);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue