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

chain.address_type_txes() fails when address type count = 0 #104

Closed
satwo opened this issue May 4, 2018 · 2 comments
Closed

chain.address_type_txes() fails when address type count = 0 #104

satwo opened this issue May 4, 2018 · 2 comments

Comments

@satwo
Copy link

satwo commented May 4, 2018

When calling chain.address_type_txes() with a block range that has 0 transactions of the specified address type, the script hangs and eventually throws a "std::bad_alloc" error.

Example:
txes_protocol = chain.address_type_txes(511645, 511646, blocksci.address_type.nulldata)`

Error:
MemoryError: std::bad_alloc

I've also reproduced this behavior with address type of multisig, eg. block 170.

@hkalodner
Copy link
Collaborator

hkalodner commented May 4, 2018

Huh interesting. I've never hit that before, but I can recreate it. If it's the same problem you're hitting, it looks a like a bug that occurs in the segmentChain method which address_type_txes depends on which occurs whenever the range of blocks contains fewer transactions than your machine has CPUs. I'm working on a fix now.

Incidentally in the just released BlockSci v0.5, chain.address_type_txes() has been replaced by chain.blocks.txes.including_output_of_type(blocksci.address_type.nulldata) which returns a blocksci.TxIterator object which is an iterator over the matching transactions and also allows vectorized operations.

@satwo
Copy link
Author

satwo commented May 4, 2018

Great, thanks for the quick fix!!

Look forward to checking out v0.5.

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