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
8b6181b579
Replaces headers db with headersFile. This should be much faster.
...
hopefully it's as durable in case of crashes.. we do fsync when updating
it so.. hopefully that's enough.
2019-12-22 11:40:25 +02:00
Calin Culianu
395d21fbaf
Refactored out the stuff we don't use in BTC.h and BTC.cpp to a separate file
...
BTC_unused.h and BTC_unused.cpp now contain this code. We may remove it
some day but now we leave it for illustrative purposes as it makes heavy
use of the bitcoin api.
2019-12-14 22:00:04 +02:00
Calin Culianu
8c3b42f1c5
Tweaks and fixups in storage class -- refactored some stuff
...
We no longer store the headers in memory. We keep them in the db. We
don't need them that often and clients can just read them from the db
if/when needed. Hopefully rocksdb is peppy enough. We can cache them if
it's a problem.
Also refactored some stuff around and simplified the storage code a
little bit.
2019-12-11 00:05:16 +02:00
Calin Culianu
7f6d025be2
nit: made GetBlockHeaderSize() return int because that's more useful to us
2019-12-03 21:53:32 +02:00
Calin Culianu
0556caf0f4
wip -- mostly works. task end has some spurious events that need removing but works well
2019-12-02 13:50:18 +02:00
Calin Culianu
16a2e195c4
Nits/refactoring for the BTC::Deserialize* functions
...
I made them all less boilerplatey and use templates. yay!
2019-12-01 15:22:12 +02:00
Calin Culianu
5842c44a79
Nits, refactorings + added shared HeaderVerifier that lives in Storage
2019-11-30 00:42:33 +02:00
Calin Culianu
7f13c60ece
nits
2019-11-26 22:43:30 +02:00
Calin Culianu
cc8ce73c5a
Made bitcoind communication more efficient by use of ParseHexFast
...
When reading data from bitcoind, we can assume the hex data it gives us
is good and there is no need to validate on a per-character basis.
Thus, we use ParseHexFast to shave off cpu cycles (it's like 6x faster
than Qt's fromHex()).
This, along with the Util::ToHexFast() (which is 60% faster than
QByteArray::toHex()), will be used in performance critical code.
2019-11-26 22:04:45 +02:00
Calin Culianu
50ee0510f3
Added ParseHexFast() to the Util namespace
...
This hex parser is 5-6x faster than what we were using before, although
it does no real verification that the input is hex digits. Usable with
results returned from bitcoind, which is never going to be
malicious/malformed and thus we can rely on this non-checking hex
parser for the performance it offers (at the expense of verification).
2019-11-26 21:01:31 +02:00
Calin Culianu
1b2522b61d
nit
2019-11-25 00:23:26 +02:00
Calin Culianu
84799f9574
Added some deserialize functions we will need and made them fast
...
Made deserialization directly from QByteArray very fast by making
VectorReader a template and having it be able to use QByteArray
2019-11-24 23:26:24 +02:00
Calin Culianu
a34681aa31
Added header download to our test code
...
It's pretty fast. Downloads all headers in 120 seconds or so. Keeps
them all in memory.
2019-11-24 22:28:26 +02:00
Calin Culianu
89aeb474c5
WIP: playing with dling data from bitcoind in Controller class
2019-11-18 20:29:21 +02:00
Calin Culianu
c0ea7f75a0
Refactored things, added "Controller" class
...
Controller will manage BitcoinD and perhaps synching to bitcoind. It can
"see" all the servers as well as bitcoind.
Also refactored things a little bit and added some more startup sanity
checks.
2019-11-18 00:21:34 +02:00
Calin Culianu
4249740857
Added CBlock and block deserialization of bitcoin blocks.
...
Works! Yay! We are one step closer to our Grande Plan.
2019-11-08 20:06:39 +02:00
Calin Culianu
0a22cdfb2d
Added more comments and additional arg to VerifyTxSignature
2019-05-07 18:27:54 +03:00
Calin Culianu
67899d5ac4
Clarified nSequence, nLocktime, nVersion in comments
2019-05-07 18:09:06 +03:00
Calin Culianu
1b3c460baa
Made all amounts referring to satoshis be signed 64 rather than unsigned
...
This is to more closely match bitcoin lib. Also it makes
differences/subtraction work better to use signed values.
2019-05-07 13:46:09 +03:00
Calin Culianu
bd8bb06203
Added Cash Address support!
...
Note internally the BTC::Address class just stores hash160.
Its ToString() is always legacy (for now), but the server can now accept
both legacy or cash address from clients. Class c'tor for
BTC::Address() auto-detects address type and decodes it appropriately.
2019-05-07 12:15:53 +03:00
Calin Culianu
80926f3d6b
Added VerifyTxSignature function to namespace BTC
2019-05-07 03:05:47 +03:00
Calin Culianu
eca4a74fed
Added sigcheck tests and more helper methods to BTC namespace
2019-05-07 02:02:23 +03:00
Calin Culianu
fa49e5af50
added ECCVerifyHandle creation at app launch
2019-05-06 22:26:51 +03:00
Calin Culianu
aa7159fa0e
Some cleanup to BTC namespace
...
Also added "MakeUnsignedTransaction"
ToDo: Verify tx sigs
2019-05-06 21:33:19 +03:00
Calin Culianu
8399ee0052
Added BTC::UTXO with tests
...
Faster encapsulation of UTXOs .. string based. Copy-on-write.
interops with bitcoin::COutPoint
2019-05-03 14:37:07 +03:00
Calin Culianu
b3159f4318
fixed broken endian check at startup. oops.
2019-05-02 05:55:14 +03:00
Calin Culianu
96b0c0e0d3
nit to endian check
2019-05-01 18:30:22 +03:00
Calin Culianu
b84bcbd8b5
Added Linux compile fixups. Also a check that the endianness in bitcoin:: is ok.
2019-05-01 18:19:17 +03:00
Calin Culianu
79e922ac9c
Nit in BTC::Address to add some syntax sugar
...
Also moved the OpCodes enum into its own file as it's long...
2019-04-30 21:17:50 +03:00
Calin Culianu
3f49dce1db
Added some small goodies
...
- Util::RunInThread to run a lambda in a thread
- App exit handling cleanup
- EXMgr uses an id for clients now
- EXMgr keeps track of lagging clients
- EXMgr more aggressive with reconnects if no valid exclients
- Nits and refactorings and misc. cleanup
2019-04-27 12:38:50 +03:00
Calin Culianu
194611a406
Revert "pragma warning tweaks got gcc and clang"
...
This reverts commit f83c3eea47 .
2019-04-26 22:21:04 +03:00
Calin Culianu
e0c5aec12e
Revert "follow-up. got it wrong for gnuc :)"
...
This reverts commit 50c28f90c3 .
2019-04-26 22:21:00 +03:00
Calin Culianu
50c28f90c3
follow-up. got it wrong for gnuc :)
2019-04-26 22:17:16 +03:00
Calin Culianu
f83c3eea47
pragma warning tweaks got gcc and clang
2019-04-26 22:11:14 +03:00
Calin Culianu
6c56a9157a
added ifdef __clang__ to clang directives
2019-04-26 14:25:39 +03:00
Calin Culianu
e5b293e2e7
suppress a compile warning
2019-04-25 21:36:05 +03:00
Calin Culianu
9a10e74ec8
updated bitcoin dir to BitcoinABC latest, removing dep. on OpenSSL
2019-04-25 21:09:05 +03:00
Calin Culianu
99c8a0a711
tweaked tests plus added comments
2019-04-25 13:46:35 +03:00
Calin Culianu
6947d57679
added concat tests plus a comment
2019-04-25 13:30:33 +03:00
Calin Culianu
6e95dec64d
tweak
2019-04-25 13:02:28 +03:00
Calin Culianu
d7d021ba2e
added some comments
2019-04-25 12:33:39 +03:00
Calin Culianu
1355fed36b
tweak
2019-04-25 10:54:28 +03:00
Calin Culianu
b2c6fc2dae
refactored Address class a bit to be more useful
2019-04-25 10:20:18 +03:00
Calin Culianu
4e17c247ac
added hashX caching to Address class
2019-04-25 10:00:55 +03:00
Calin Culianu
7fb9867844
finished up ByteArray
2019-04-25 09:45:08 +03:00
Calin Culianu
d6d88761d8
testing
2019-04-25 09:22:25 +03:00
Calin Culianu
fe45011530
Added ByteArray type to BTC namespace
2019-04-25 09:13:50 +03:00
Calin Culianu
59edb8fe81
nit
2019-04-24 23:50:13 +03:00