Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

btcutil: reuse serialized tx during TxHash #2081

Merged
merged 3 commits into from
Dec 29, 2023

Conversation

Roasbeef
Copy link
Member

This is #2023, but with some code style fixes and added benchmarks.

kcalvinalvin and others added 3 commits December 21, 2023 13:43
btcutil.Block caches the serialized raw bytes of the block during ibd.
This serialized block bytes includes the serialized tx. The current tx
hash generation will re-serialized the de-serialized tx to create the
raw bytes and it'll only then hash that.

This commit changes the code so that the re-serialization never happens,
saving tons of cpu and memory overhead.
@coveralls
Copy link

Pull Request Test Coverage Report for Build 7353073196

  • 0 of 0 changed or added relevant lines in 0 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage decreased (-0.007%) to 56.514%

Totals Coverage Status
Change from base Build 7299011825: -0.007%
Covered Lines: 28647
Relevant Lines: 50690

💛 - Coveralls

@Roasbeef Roasbeef merged commit 790c570 into btcsuite:master Dec 29, 2023
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants