Commit Graph

1191 Commits

Author SHA1 Message Date
tomFlowee 5f629a161e Let the actions do the assignments of segments.
This removes some code from the connectionmanager / blockchain classes
which assigned a random segment on a new peer.
2022-07-13 13:50:23 +02:00
tomFlowee d066351103 Add convenience methods. 2022-07-12 15:05:12 +02:00
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 a737803198 Install HDMasterPubkey.h 2022-07-11 12:55:31 +02:00
tomFlowee 0c2ddfe760 fix language in comment 2022-07-10 12:07:11 +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 0f91e9ac46 Remove dead code 2022-07-06 22:08:50 +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 32c7f28b24 Change cast.
This correctly makes our value signed before turning it into
a negative number.
2022-07-06 14:28:34 +02:00
tomFlowee 1572608605 Make this explicit
Since the default copy constructor of the HDMasterKey uses the copy
constructor of CKey, make the latter have a copy constructor explicitly
defined as well.
2022-07-06 14:10:23 +02:00
tomFlowee bc52d3eda0 Be consistent in the header file and avoid misuse. 2022-07-06 14:09:17 +02:00
tomFlowee 82ca91d836 Use slightly less memory.
This avoids creating an empty static string in most well written apps.
Also use const ref for a loop because that avoids copying.
2022-07-06 14:08:18 +02:00
tomFlowee cfc50b3a9a Always initialize this field in the constructor.
This avoids future problems should the constructor be used elsewhere.
2022-07-06 14:05:44 +02:00
tomFlowee 640d327311 Make disabled wallet stop getting data. 2022-06-24 14:13:32 +02:00
tomFlowee e17ba3bc58 Add a property 'enabled' on PrivacySegment
A not-enabled PrivacySegment will not have its merkleblocks downloaded.
2022-06-23 23:17:05 +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 0f434e0425 Check file exists before using it. 2022-05-03 18:50:53 +02:00
tomFlowee 2eb7273d3b Don't assume value. 2022-05-01 17:34:59 +02:00
tomFlowee 7a7c80913c lowecase method names. 2022-05-01 14:53:52 +02:00
tomFlowee 2dea9d4884 API review this class 2022-04-30 20:27:59 +02:00
tomFlowee 6f4ef3bbdb Detect when outgoing connection died
The server always sends pongs in response to our pings, but we assumed
that the underlying OS would close a connection when the other side
isn't replying (ACKs).

Now we take this responsibility in the code and when no pongs are
registered we also close and re-establish the connection.

This additionally shortens the ping time to 30 seconds and the timeout
to 90 seconds.
2022-04-20 11:41:15 +02:00
tomFlowee df002c4973 Count the 'endofheader' byte too.
A header is actually never empty, but lets not make that assumption in
code.
2022-04-20 11:37:33 +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 e5c97d1e87 Use non-openssl cleanse 2022-04-06 12:04:23 +02:00
tomFlowee a47a7072b3 Add unit test for allocator too 2022-04-06 11:39:49 +02:00
tomFlowee 0d4b214e23 Move over to the new allocator 2022-04-06 10:24:16 +02:00
tomFlowee 512d49785a Pass enum by value 2022-04-05 22:13:55 +02:00
tomFlowee 9a332d9b7b Fix endless loop bug 2022-03-23 22:48:44 +01:00
tomFlowee 80f6c145b8 Update readme 2022-02-26 11:49:56 +01: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 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 c0989158c0 Add API docs. 2022-02-08 19:03:14 +01:00
tomFlowee 6bfde84afb Add default binding configur 'ygg'.
This makes the server bind only to yggdrasil (a mesh networking
solution) addresses which have as specific advantage that it does
protocol-level encryption.
2022-01-29 12:04:08 +01:00
tomFlowee c7a3478be2 Fix constructor from sometimes throwing 2022-01-26 15:27:30 +01:00
tomFlowee 41e00b134f Add convenience methods on ConstBuffer
this adds indexOf() and toString()
2022-01-25 23:59:54 +01:00
tomFlowee 1d25e45a1c Reconcile more places to use pools API
This removes 2 more custom solutions to converge on one
  Streaming::pool()
namespaced method.
2022-01-25 23:20:12 +01:00