mirror of
https://github.com/bitcoin/bitcoin.git
synced 2026-03-22 21:50:14 +01:00
Optimize GetWitnessHash() for non-segwit transactions
This commit is contained in:
@@ -69,6 +69,9 @@ uint256 CTransaction::ComputeHash() const
|
|||||||
|
|
||||||
uint256 CTransaction::GetWitnessHash() const
|
uint256 CTransaction::GetWitnessHash() const
|
||||||
{
|
{
|
||||||
|
if (!HasWitness()) {
|
||||||
|
return GetHash();
|
||||||
|
}
|
||||||
return SerializeHash(*this, SER_GETHASH, 0);
|
return SerializeHash(*this, SER_GETHASH, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user