-
Notifications
You must be signed in to change notification settings - Fork 187
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
Fix leveldb corruption bug in asutoshpalai's get_ordered_blocks() fork #28
Conversation
…sed binascii dependency.
CI tests are failing because of the new dependency on LevelDB.
I don't have any experience with Travis, but I'm pretty sure installing LevelDB would fix the problem. That does mean adding LevelDB as a dependency to this project, but IMHO that is a worthwhile dependency addition for this powerful new feature. |
Looking at plyvel's docs, it seems that the pip version assumes the correct version of leveldb is installed, which is not the case for most Linux :
We should update the README to mention this. |
@brannondorsey I've just made a PR (brangerbriz#1) to your repo that should make this one mergeable 🤞 |
Fix travis build and mention leveldb-dev dep in README
Strange, I've got Leveldb 1.18-5 installed (via I saw that you added a |
The |
Oops, sorry, I meant document that it is necessary to install libleveldb-dev version 1.2.0, not run |
This PR is based on @asutoshpalai's #17. I've swapped the
leveldb
dependency withplyvel==1.0.4
and fixed the.bitcoin/blocks/index
corruption issue discussed in his PR. It would seem that Bitcoin Core doesn't use Snappy compression, so it must be disabled explicitly when connecting to the database withplyvel
. I've tested these fixes withbitcoind
and these changes are compatible with their leveldb index (you don't have to re-index every time using this PR).I've also added the ability to iterate through the blocks in reverse order by specifying a
start
parameter that is greater than theend
parameter inblockchain.get_ordered_blocks(...)
.I've tested all of the
blockchain.get_ordered_blocks(...)
PRs on this repo, and @asutoshpalai's is hands down my favorite. Usingbitcoind
's own leveldb database is an elegant solution to the ordering problem 🥇. This feature is very useful and I vote for merging it.