1) Receiving coins regressed after the last optimization. Resolves issue 49.
2) Reorg handling expected to be able to connect all inputs.
Also other minor fixes and small additions.
Note that the endianness of the hashes is still very ad-hoc and messy. Next step is to pick an endianness and stick with it, to reduce the number of times reverseBytes is used.
- Extract serialization code out of NetworkConnection into a new class
- Created classes for Ping and VerAck messages
- Use reflection to create new message classes
- Add a few test cases to exercise the BitcoinSerializer class
Patch by Noa Resare.
On a MacBook pro with this store, the chain can be downloaded at about 2000 blocks per second. Difficulty transitions are not optimized but take around 50 msec. On a Google Nexus S the chain can be downloaded (via wifi) at 200 blocks per second and difficulty traversals take 2 seconds. At this time the profiles on both devices are dominated by verification costs, not storage.
- Split the unit tests for this into a separate file
- Add more tests for double spends, reversal of external spends and more edge cases
- Handle the case where transactions should be resurrected after a re-org
- Handle the case where transactions are overridden by double spends
Should address [some of] the points Miron raised during his review. There are likely still bugs but it's a lot closer to correct than before.
Activated the disabled tests in testForking, added a bunch more tests for this functionality.
Added various utility methods and made small fixes as required.
This changes the wallet format and invalidates existing wallets.
- Store the block chain using a get/put interface keyed by hash,
so we can add disk storage later.
- Add unit tests for difficulty transitions. Move some stuff into
NetworkParameters to make that easier.
- Track the best chain using total work done. Inform the wallet
when a re-org takes place. Wallet currently doesn't do anything
with this beyond informing the event listeners.
With this patch we're getting closer to a correct SPV implementation.
Introduce a unit test NetworkParameters that has very easy difficulty.
Correct some assertTrue(false) type checks to use fail() instead.
Make ALLOWED_TIME_DRIFT non-public until I have a good explanation in the javadocs of what it's for.
Simplify Block.equals