dogecoin / libdohj

Java library for adding altcoin support to bitcoinj
Apache License 2.0
109 stars 88 forks source link

[DON'T MERGE] Sync fixes #7

Closed langerhans closed 8 years ago

langerhans commented 9 years ago

Not ready for merge yet, but PRing to have it here.
You probably know better how you thought the block/header parsing will work, as my current solution feels kinda hacky.

This syncs a lot further than yesterday though, so it is progress. I won't be around until tomorrow afternoon/evening, so if you want to poke at it (or me), here it is.

367655d should be correct though, that's why it's an extra commit.

Currently it stops syncing at block bd98a06391115285265c04984e8505229739f6ffa5d498929a91fbe7c281ea7b with "Aux POW wrong index". I think then none may be wrong there.

rnicoll commented 9 years ago

https://github.com/rnicoll/bitcoinj/commit/04d04599fdbaf918cb02cffcfb7ed84ae3ea1b65 will form the basis of doing this less invasively, later, but doesn't actually work right now for reasons I can't see (checking the parsed headers by eye it looks fine)

rnicoll commented 9 years ago

bitcoinj/bitcoinj#1102 should fix most of this

langerhans commented 8 years ago

Updated this, still broken tho. I get to the same block, that fails to verify with the same Exception. I added the test, and under testing it parses and checks without issue. Something is fishy here.

The optimalEncodingSize change was needed cause parseTransactions would reset it to 80 since there are no transactions.

Maybe you have an idea what's wrong :crystal_ball:

langerhans commented 8 years ago

Updated with the cursor length fix thing...