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

Deserialization usage example #20

Closed
maufl opened this issue Mar 6, 2017 · 3 comments
Closed

Deserialization usage example #20

maufl opened this issue Mar 6, 2017 · 3 comments

Comments

@maufl
Copy link

maufl commented Mar 6, 2017

Hey, I would like to use this library to analyse the blockchain. I already have a downloaded copy, using the standard bitcoind. I assumed that I could use bitcoin::network::serialize::deserialize to deserialize a blk*.dat file into a Block struct. Is that correct? When I try to do that, the deserializer allocates an extremely large Vec<u8> and crashes because it's out of memory.

@apoelstra
Copy link
Member

No, the blk*.dat files are not stored in the same format as blocks are in the Bitcoin network protocol. You cannot parse them with rust-bitcoin.

Thank you for reporting this memory-DoS issue though!

@maufl
Copy link
Author

maufl commented Mar 6, 2017

Thanks for your fast response! I'll look for another way then. If you want you can close this issue.

@apoelstra
Copy link
Member

Fixed in apoelstra@cdb452f

Tibo-lg pushed a commit to p2pderivatives/rust-bitcoin that referenced this issue Sep 1, 2020
Davidson-Souza pushed a commit to Davidson-Souza/rust-bitcoin that referenced this issue Jul 12, 2023
expose 2-key version of PublicKey::combine
yancyribbens pushed a commit to yancyribbens/rust-bitcoin that referenced this issue Mar 23, 2024
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

No branches or pull requests

2 participants