Commit Graph

289 Commits

Author SHA1 Message Date
tomFlowee 8ff3802687 Fixes in the HDMaster* classes 2022-07-11 18:04:14 +02:00
tomFlowee 887fbef139 Add some convenients methods. 2022-07-11 13:31:24 +02:00
tomFlowee 9a9a2d0829 Avoid duplicating magic numbers
Move the prefix numbers all to one place to avoid copy-pasting them.
Also make the xpub more complete.
2022-07-08 13:14:41 +02:00
tomFlowee f318774663 Add HDMasterPubkey to derive xpub style addresses
This also alters the 'toString()' on HDMasterKey to stop giving
a rather useless xpub and turn it into a dedicated toXPubString()

Closes: #1
2022-07-07 21:16:50 +02:00
tomFlowee 0eee5a06b6 Split test into two.
Since they are in different libs, it makes sense to put the right part in
the right test dir.
2022-07-07 21:00:53 +02:00
tomFlowee 1ab4d88993 Split version.h
Version.h held mostly stuff for protocol.h, which is a hub-specific file.
The only thing that we actually use is the PROTOCOL_VERSION in our code
and as such that one moved to the interfaces dir.
2022-07-06 22:50:53 +02:00
tomFlowee 05bbba3cb3 Rename class CKey -> PrivateKey 2022-07-06 22:12:33 +02:00
tomFlowee c9af7cca4a Rename class CPubKey -> PublicKey 2022-07-06 21:56:34 +02:00
tomFlowee c33d54ed7d Rename class CKeyID -> KeyId 2022-07-06 21:52:47 +02:00
tomFlowee c2c5fd7973 Make compile 2022-06-20 16:27:00 +02:00
tomFlowee 9fa877f425 Rename hashing methods to start with lowercase 2022-05-17 00:46:54 +02:00
tomFlowee 1ebcd0077a Cleanup API and install header
This changes the usage of 'unsigned char*' in the API with the much more
common 'char *' as that has literally no effect on the generated code
anyway.
2022-05-11 23:37:51 +02:00
tomFlowee cca8a885bc Fix coding style issues
Follow the coding styleguide and make the methods lowercase on CKey
2022-05-11 13:46:15 +02:00
tomFlowee 7b57024413 Make set() be internally consistent
setting an incorrect value should not keep the old data after we already
update the fValid boolean.
That would give the user the impression that the data was removed while
it really isn't.
2022-05-11 13:20:15 +02:00
tomFlowee 7a7c80913c lowecase method names. 2022-05-01 14:53:52 +02:00
tomFlowee aef7366034 Implement BIP69 in TransactionBuilder
This adds support for the
 Lexicographical Indexing of Transaction Inputs and Outputs
anonimize concepts of transactions directly in the transaction builder.
2022-04-15 17:33:55 +02:00
tomFlowee e23925a954 Clean up the API and implement logging on failure 2022-04-06 14:23:37 +02:00
tomFlowee 0663515da0 Fix naming of tests 2022-04-06 11:46:40 +02:00
tomFlowee a47a7072b3 Add unit test for allocator too 2022-04-06 11:39:49 +02:00
tomFlowee fa70e99dae Make include more on-topic 2022-04-06 11:32:44 +02:00
tomFlowee 0d4b214e23 Move over to the new allocator 2022-04-06 10:24:16 +02:00
tomFlowee b4a3da2642 The 'Server' and 'Api' dirs are not libs
These are technically static libs, but not in any way shared libs.
They are used solely only by this repo and really only by the hub.

Most important, no header files are installed and basically none of
the normal rules for reusable libraries are applied to these files.
2022-02-22 18:39:13 +01:00
tomFlowee a4bf291040 Move another file to become qtestlib 2022-02-22 17:35:33 +01:00
tomFlowee ceb11cd273 Cleanup coding in file a little. 2022-02-22 17:28:33 +01:00
tomFlowee a7854430a2 Move from legacy boost to qtestlib. 2022-02-22 17:24:01 +01:00
tomFlowee 4c92085e6c Remove txid from metablock.
Flowee experimented with a 'metablock' a piece of data stored next to
the blocks with some metadata it discovered during validation.
One of those pieces of info is the txid, which turned out to be too big
to store here (16GB or so added).

This change removes the txid but it does keep the script-flags and the
fees for each transaction (8 bytes per tx) which adds maybe 3GB to the
entire chain.
2022-02-22 16:15:33 +01:00
tomFlowee bdbc53ac91 Remove old wallet code.
Again, wallet has moved to flowee-pay
2022-02-14 17:53:47 +01:00
tomFlowee 26262783de Allow mid(1, 0) to be called
This now creates a zero size, empty, result.
2022-02-10 18:02:50 +01:00
tomFlowee 41e00b134f Add convenience methods on ConstBuffer
this adds indexOf() and toString()
2022-01-25 23:59:54 +01:00
tomFlowee 9c4984dcf7 [P2Plib] Make initial startup 70% faster
What we did previously is load a static chain which was to avoid lots of
work by simply memory-mapping the data instead of inserting it in a
vector.

This improves upon that by also having a metadata file which holds the
block-hashes directly readable. This avoids us having to iterate over
the blockheaders and hashing them.

Additionally we now have a single chain-work field that is the total
amount added work for the headers. This saves us from doing 256-bit
divisions and work for each blockheader as well.

Result is that we make the statup mostly about memory moving and remove
all CPU intensive stuff. Going from 1450ms to 400ms on desktop.
I expect an even greater gain on mobile CPUs.
2022-01-12 19:45:51 +01:00
tomFlowee 1b5ae89d31 [Refactor] rename FastTransaction.{h|cpp} -> Tx.* 2021-11-02 11:05:14 +01:00
tomFlowee 639a57d957 [Refactor] primitives/BlockHeader -> BlockHeaderFields
This avoids a naming conflict with a p2p class BlockHeader.

Notice that the block data structures are mostly still private API, they
are in the utils dir but headers are not installed, nobody has needed
them so far.
2021-11-02 11:05:14 +01:00
tomFlowee 50af3dc02c [Refactor] rename FastBlock.{h|cpp} -> Block.* 2021-11-02 10:24:58 +01:00
tomFlowee 6ff0e7c0de [Refactor] FastBlock -> Block 2021-11-02 10:18:24 +01:00
tomFlowee dce57fd8ea [Refactor] rename block.{h|cpp} -> MutableBlock.* 2021-11-02 10:13:23 +01:00
tomFlowee 406dc46671 [Refactor] move CBlockLocator to libs/server
Its not needed anywhere outside the apps.
2021-11-02 09:59:13 +01:00
tomFlowee 4689cc6a92 [Refactor] CBlock -> MutableBlock 2021-11-02 09:36:09 +01:00
tomFlowee 64d901d760 Refactor; CBlockHeader -> BlockHeader 2021-11-02 09:28:35 +01:00
tomFlowee 851d147dcd Add way to go from seed to mnemonic. 2021-10-27 19:14:09 +02:00
tomFlowee 4252e859e7 Remove obsolete (and untested) code. 2021-10-13 17:06:58 +02:00
tomFlowee c264641cbe Provide hierarchically deterministic wallet parts
This introduces a Mnemonic class for BIP39 (seed words)
validation as well as a HDMasterKey class with provides the
BIP32 & BIP43 support.

All tests went into the apputils unit test.
2021-10-13 17:03:02 +02:00
tomFlowee 919d6ffbc5 Make test less fragile.
This avoids depending on Qt CoW not hitting on returning it.
Also fix open() in release builds.
2021-08-09 21:26:07 +02:00
tomFlowee ae78dd0bb8 Update email address 2021-06-20 22:44:44 +02:00
tomFlowee 460d4be807 Add new method Blockchain::blockHeightAtTime() 2021-05-28 14:52:27 +02:00
tomFlowee d1fa3fa4a9 [P2P] Allow static loading of blockheaders
This adds a unit test for the Blockchain class in the p2p lib and this
introduces the functionality to have a blockchain pre-shipped with an
app.
2021-05-27 19:08:46 +02:00
tomFlowee f9a0050220 Update TransactionBuilder / signature type handling
The choice between Schnorr and ECDSA signatures is now per input instead
of once choice for the entire transaction.
2021-05-04 16:57:55 +02:00
tomFlowee 76fde4a94c Make the test go back to ECDSA style signatures. 2021-04-19 17:07:02 +02:00
tomFlowee c58586516d Allow for longer mock-chains of blocks.
In RegTest we have a much shorter cycle of halving, take this into
account when building blocks.
2021-04-19 17:06:15 +02:00
tomFlowee f163e942a7 Add Schnorr unit tests 2021-04-19 16:28:54 +02:00
tomFlowee 6682a4a5b2 Rename CKey::Sign() -> signECDSA() 2021-04-19 15:45:02 +02:00