Commit graph

10 commits

Author SHA1 Message Date
Calin Culianu
a831cce8ac
Modified license preamble to say "Bitcoin Cash" instead of "Electron Cash"
The hope is maybe people will adopt this with other wallets...
2019-12-28 23:48:24 +02:00
Calin Culianu
405335c173
Added LICENSE preamble to all top-level source files
GPL v3. YAY!
2019-12-28 23:46:05 +02:00
Calin Culianu
3321d9f440
Prevented a potential deadlock in Merkle::Cache
Use byzantine code, get byzantine behavior.

This should be the last of the fixes hopefully.

Also in this commit: Some simplification in Servers.cpp and some comment
fixups and exception message cleanup.
2019-12-23 09:12:17 +02:00
Calin Culianu
146ce39514
Bugfix in Merkle cache
Oops. :) Truncate was buggy. Fixed.

Also made all the merkle functions throw rather than just print errors
to the log.  They do print errors to the log as well for critical
errors.
2019-12-22 23:51:53 +02:00
Calin Culianu
352390fac5
minor nits in Merkle.cpp 2019-12-22 17:37:23 +02:00
Calin Culianu
fe5d7ea5b9
Merkle yay!
Got the cp_height thing working for blockchain.block.header

Next up, the "headers" version. W00t! :D
2019-12-22 01:20:24 +02:00
Calin Culianu
e18c668365
wip 2019-12-21 23:27:47 +02:00
Calin Culianu
52b62501b3
Added Merkle performance test to Merkle::test
This is so we can characterize how costly the O(N log N) is. It's not
too bad but would need a threedpool worker to calculate it for larger
sets of txhashes (say >10k?), in order to keep the server from becomming
laggy.
2019-12-21 08:55:26 +02:00
Calin Culianu
2e9c2dab63
Using our new Merkle.cpp, fully implemented 2 of the transaction methods
blockchain.transaction.id_from_pos is now fully implemented, as is
blockchain.transaction.get_merkle.

They both use a cache to store the txHashes for a particular block, and
resort to reading from the disk file if not found in cache.

This cache stores the txHashes for 500 of the most recently queried
blocks.  In the worst pathological circumstances of 64k tx's per block,
the cache would use about 1.5GB of memory at worst.  In practice it will
use much less as blocks are empty.
2019-12-20 19:12:05 +02:00
Calin Culianu
4009b9a970
Initial implementation of the Merkle namespace
It seems to have all the utility functions we need to create those
merkle branch things for the protocol.
2019-12-20 14:30:39 +02:00