Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 1 addition & 3 deletions src/messages/block.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -55,12 +55,11 @@ typename block::cptr block::deserialize(uint32_t version,
{
// TODO: consider having tx cache serialized sizes.
const auto true_size = tx->serialized_size(true);
////tx->set_witness_hash(bitcoin_hash(true_size, begin));
tx->set_witness_hash(bitcoin_hash(true_size, begin));

// If segregated the hashes are distinct, cache both.
if (tx->is_segregated())
{
// Coinbase witness hash is null_hash, do not cache.
if (!coinbase)
{
const auto end = std::next(begin, tx->serialized_size(false));
Expand All @@ -69,7 +68,6 @@ typename block::cptr block::deserialize(uint32_t version,
}
else
{
// Avoiding witness hash caching for now.
tx->set_hash(bitcoin_hash(true_size, begin));
}

Expand Down
3 changes: 1 addition & 2 deletions src/messages/transaction.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ typename transaction::cptr transaction::deserialize(uint32_t version,
return nullptr;

const auto& tx = *message->transaction_ptr;
////tx.set_witness_hash(bitcoin_hash(data));
tx.set_witness_hash(bitcoin_hash(data));

// If segregated the hashes are distinct, cache both.
if (tx.is_segregated())
Expand All @@ -74,7 +74,6 @@ typename transaction::cptr transaction::deserialize(uint32_t version,
}
else
{
// Avoiding witness hash caching for now.
tx.set_hash(bitcoin_hash(data));
}

Expand Down