Skip to content

Commit

Permalink
Merge pull request #1456 from evoskuil/master
Browse files Browse the repository at this point in the history
Style, use nominal_hash_.
  • Loading branch information
evoskuil authored May 23, 2024
2 parents 6daade0 + 8c6ea62 commit f23a5a7
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion include/bitcoin/system/chain/transaction.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -263,7 +263,7 @@ class BC_API transaction

// Signature and identity hash cashing (witness hash if witnessed).
mutable std::unique_ptr<hash_cache> cache_{};
mutable std::unique_ptr<const hash_digest> hash_{};
mutable std::unique_ptr<const hash_digest> nominal_hash_{};
mutable std::unique_ptr<const hash_digest> witness_hash_{};
};

Expand Down
6 changes: 3 additions & 3 deletions src/chain/transaction.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -410,7 +410,7 @@ uint64_t transaction::fee() const NOEXCEPT
void transaction::set_hash(hash_digest&& hash) const NOEXCEPT
{
BC_PUSH_WARNING(NO_THROW_IN_NOEXCEPT)
hash_ = std::make_unique<const hash_digest>(std::move(hash));
nominal_hash_ = std::make_unique<const hash_digest>(std::move(hash));
BC_POP_WARNING()
}

Expand All @@ -435,12 +435,12 @@ hash_digest transaction::hash(bool witness) const NOEXCEPT
}
else
{
if (hash_) return *hash_;
if (nominal_hash_) return *nominal_hash_;
}
}
else
{
if (hash_) return *hash_;
if (nominal_hash_) return *nominal_hash_;
if (witness_hash_) return *witness_hash_;
}

Expand Down

0 comments on commit f23a5a7

Please sign in to comment.