diff --git a/src/primitives/transaction.cpp b/src/primitives/transaction.cpp index ec9ce51508..93430c6998 100644 --- a/src/primitives/transaction.cpp +++ b/src/primitives/transaction.cpp @@ -73,6 +73,13 @@ Txid CMutableTransaction::GetHash() const return Txid::FromUint256((HashWriter{} << TX_NO_WITNESS(*this)).GetHash()); } +bool CTransaction::ComputeHasWitness() const +{ + return std::any_of(vin.begin(), vin.end(), [](const auto& input) { + return !input.scriptWitness.IsNull(); + }); +} + Txid CTransaction::ComputeHash() const { return Txid::FromUint256((HashWriter{} << TX_NO_WITNESS(*this)).GetHash());