Skip to content

Commit

Permalink
Style.
Browse files Browse the repository at this point in the history
  • Loading branch information
evoskuil committed Jul 16, 2024
1 parent f04a282 commit 97eda5e
Showing 1 changed file with 4 additions and 18 deletions.
22 changes: 4 additions & 18 deletions src/chain/transaction.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -98,21 +98,12 @@ transaction::transaction(const transaction& other) NOEXCEPT
other.valid_)
{
// Optimized for faster optional, not for copy.

if (other.nominal_hash_)
nominal_hash_ = to_unique(*other.nominal_hash_);
else
nominal_hash_.reset();

if (other.witness_hash_)
witness_hash_ = to_unique(*other.witness_hash_);
else
witness_hash_.reset();

if (other.sighash_cache_)
sighash_cache_ = to_unique(*other.sighash_cache_);
else
sighash_cache_.reset();
}

transaction::transaction(uint32_t version, chain::inputs&& inputs,
Expand Down Expand Up @@ -211,22 +202,17 @@ transaction& transaction::operator=(const transaction& other) NOEXCEPT
valid_ = other.valid_;
size_ = other.size_;

// Optimized for faster optional, not for copy.
nominal_hash_.reset();
witness_hash_.reset();
sighash_cache_.reset();

// Optimized for faster optional, not for copy.
if (other.nominal_hash_)
nominal_hash_ = to_unique(*other.nominal_hash_);
else
nominal_hash_.reset();

if (other.witness_hash_)
witness_hash_ = to_unique(*other.witness_hash_);
else
witness_hash_.reset();

if (other.sighash_cache_)
sighash_cache_ = to_unique(*other.sighash_cache_);
else
sighash_cache_.reset();

return *this;
}
Expand Down

0 comments on commit 97eda5e

Please sign in to comment.