Commit Graph

12716 Commits

Author SHA1 Message Date
tomFlowee 1c53a18048 update version to 2023.11.1 2023.11.1 2023-11-30 19:32:42 +01:00
tomFlowee 9a0cf513b5 Add constbuffer constructor 2023-11-24 22:20:40 +01:00
tomFlowee 2d0aec2cd7 Rename file to match class it is in
This follows the coding style guideline that the file that contains a
class should follow the exact name of this (main) class.

key.{h|cpp} -> PrivateKey.{h|cpp}
2023-11-24 22:20:40 +01:00
tomFlowee fce11e8d4f Rename file to match class it is in.
This follows the coding style guideline that the file that contains a
class should follow the exact name of this (main) class.

pubkey.{h|cpp} -> PublicKey.{h|cpp}
pubkey_utils.{h|cpp} -> PublicKeyUtils.{h|cpp}
2023-11-24 22:20:40 +01:00
tomFlowee afa075ca40 Stop using deprecated call 2023-11-24 22:20:40 +01:00
tomFlowee 8e833c0a63 Add versioning and fix compacting
The system writes a new file every single run (provided new headers were
received) and we sometimes compact them into a big file again.
The code forgot to remove the newly introduced info files of the old
files it compacted. Leaving confusing things happening after.

This solves that by making the first run remove all info files and re-
build them, adding a version byte to allow us freedom to do that in the
future again.
2023.11.0
2023-11-04 15:52:41 +01:00
tomFlowee 1237d8eefd new month, new version 2023-11-03 22:20:55 +01:00
tomFlowee 1c6341ff1d The owner agreed it should be disabled for now.
The bchd seed owner says that since there are no bchd nodes on main-chain
due to the code being outdated, the seed is empty.
We hope this will change in the future, but for now it makes no sense to
query it since it will just generate a fail.
2023-11-03 22:18:30 +01:00
tomFlowee 141553ce6e Improve stale getheaders peer detection
This improves several corner cases on detecting if a peer we
are requesting headers from is actually giving them to us.

Specifically, the height could be zero for a genesis-only view, which
caused the detection to always give the higest score (height zero is
seen as special).

After a node is disconnected we now also reset the history in order to
let the new node get measured from only its own performance.
2023-11-03 22:12:02 +01:00
tomFlowee 4970557f74 Account for a headers message starting with genesis 2023-11-03 22:09:10 +01:00
tomFlowee 8cf80a8634 Cleanup GetHeaders p2p call
Move the builder into the place its used (leftover from earlier ownership change)
Make the message we build be more compatible.
2023-11-03 22:07:57 +01:00
tomFlowee 64b494c97b Simplify the statemachine int. 2023-11-03 18:28:27 +01:00
tomFlowee c8fc2823e7 Port to non-deprecated methods. 2023-11-03 16:59:29 +01:00
tomFlowee 7fdffb919f New versions 2023-11-01 20:33:58 +01:00
tomFlowee 470657fd0e New version 2023.10.0 2023-10-29 11:45:12 +01:00
tomFlowee 1f57aef0df Add comment. 2023-10-24 20:29:31 +02:00
tomFlowee 1b7b24ee9f Fixlets in API docs. Correct arg-name. 2023-10-24 20:24:59 +02:00
tomFlowee 457e8cc78a Remove not written info file
We optimistically create a new info file but as we start we might
instantly realize the file is useless and give up before having written
a single byte.
We now remove that file to avoid stale state.

Also be more verbose on warnings.
2023-10-24 15:13:24 +02:00
tomFlowee b74cb6b029 Pull request 'Add support for Electrum mnemonic phrases.'
Reviewed-on: https://codeberg.org/Flowee/thehub/pulls/5
2023-10-23 14:42:20 +00:00
Calin Culianu 49dab048ab Nit: Default "unknown" mnemonic format to BIP39 2023-10-19 17:02:14 +03:00
Calin Culianu 616ab329e1 Added test vectors for parsing Electrum vs BIP39 to test_apputils.cpp 2023-10-19 16:29:13 +03:00
Calin Culianu 3e05677abf Implemented reviewer suggestion + added unit tests
- Changed API for HDMasterKey::fromMnemonic to use an enum to specify
  BIP39 vs Electrum format phrase
- Added unit test for this class to existing unit tests
2023-10-19 16:13:32 +03:00
Calin Culianu 26c39f58ac Add support for Electrum mnemonic phrases.
These are almost identical to BIP39. They use the same word list except:

- The checksum is calculated differently
- Deriving the master key from them uses a different pbkdf512 salt
  ("electrum" vs "mnemonic")
2023-10-18 20:56:20 +03:00
Tom Zander 89624db80c Merge pull request 'Fix some build issues on macOS + clang' (#4) from cculianu/thehub:fix_build_macos_clang into master
Reviewed-on: https://codeberg.org/Flowee/thehub/pulls/4
2023-10-17 19:15:45 +00:00
Calin Culianu 3945e3069a Fix some build issues on macOS + clang 2023-10-17 22:01:20 +03:00
tomFlowee f39953cdc3 Throw properly
off-by-one fix, would not throw when referring to 1 item after the
dataset.
2023-10-16 20:30:42 +02:00
tomFlowee 51e872152b Redo various pieces of logic to be more sane.
A review of the numbers because this easily becomes off-by-one fest
that can make you get lost for hours! :-)
2023-10-16 20:29:14 +02:00
tomFlowee cbeb6dbb0a Allow a static blocks file to start at a checkpoint
The blockchain class can effectively now be shallow,
we can have a list of blockheaders of, for instance, the last year
alone. It builds on top of a known checkpoint (hardcoded block data)
and as long as we do not access block info that is unavailable, things
just work like normal.

We throw at the request of a blockheader that is too old.
2023-10-09 18:08:10 +02:00
tomFlowee 10034d9f0e Add chain-work to checkpoints.
Also rename the member 'checkpoints' to include the m_ prefix to be
internally consistent.
2023-10-09 11:35:20 +02:00
tomFlowee 35df33f3ab Do not allocate items for static block
This changed the vector to no longer have empty entries for the static
chain which were never inserted or read.
2023-10-09 11:35:20 +02:00
tomFlowee 6377a62baf Blockchain database fixes for compression of data. 2023-10-08 12:15:09 +02:00
tomFlowee a65284e0ec Add ConstBuffer clear which makes it invalid. 2023-09-04 14:10:35 +02:00
tomFlowee a2bad4e298 Make bufferpool more sturdy.
Calling commit with a negative value now no longer returns a
valid-but-broken buffer. It now returns an invalid buffer.
2023-09-04 14:10:35 +02:00
tomFlowee 8e2f57ddf7 Implement int32/int64 support for protoparser. 2023-09-02 23:14:18 +02:00
tomFlowee 04877ab4b1 Add new method to convert TO cashaddress
Given an output script, convert to a cash-address.

Notice that this only supports p2pkh / p2sh for now.
2023-09-02 19:40:46 +02:00
tomFlowee 7aba8ac522 Start new version 2023.08.0 2023-08-17 21:35:51 +02:00
tomFlowee 33616fdcec Keep the DB cleaner on peer rejection
Should the peer have been rejected on status or similar, we don't
register a successful connection and avoid the peer from being selected
again since then we don't remove the punishment done on connection
start.
2023-08-17 21:32:09 +02:00
tomFlowee 003cdd6b23 Fix logic; missing braces. 2023-08-17 21:32:09 +02:00
tomFlowee 991eadb311 Add some more debugging output 2023-08-17 21:32:09 +02:00
tomFlowee dba654080e Fix us not getting updates
This fixes the regression that caused a wallet not getting updates after
some time.
2023-08-17 16:58:07 +02:00
tomFlowee 90c56b9caa Make protobuf usage default off.
Protobuf seems to have an incompatible cmake every single release,
which makes including it with cmake itself stupid and indeed lead
to linking or even compile errors.

So, the point of not wanting to use protobuffers directly got again
proven in practice as its a messy thing in all regards.

This makes the unit test for our reimplementation of protobuf
parsing/building become optional. The unit test is the only one
that actually uses the protocol buffers stuff itself, as such
turning that off by default isolates our users from the mess it is.
2023-08-16 16:42:14 +02:00
tomFlowee 220965ceae Add operator== to EndPoint 2023-08-13 13:59:24 +02:00
tomFlowee f1f148496f Add API docs. 2023-08-02 11:54:05 +02:00
tomFlowee 9f16d67460 Make API more robust
this avoids the endPoint() method sometimes throwing an exception from
std::map::at confusing the caller.
2023-07-20 20:59:26 +02:00
tomFlowee 30ea4aeb98 api docs 2023-07-20 17:45:37 +02:00
tomFlowee 69562c6767 Finish the method signature, add size. 2023-07-17 21:02:43 +02:00
tomFlowee 9685d484cc Init member var 2023-07-17 21:01:59 +02:00
tomFlowee aecaa14d64 Fix constness. 2023-07-15 22:18:14 +02:00
tomFlowee c8fe78f28e whitespace cleanup 2023-07-15 22:01:30 +02:00
tomFlowee 7c7fc70d7d Split app and lib versioning 2023-07-15 22:01:07 +02:00