Commit Graph

12558 Commits

Author SHA1 Message Date
tomFlowee 81d754a03a Merge branch 'master' of codeberg:thehub 2023-02-22 10:50:21 +01:00
tomFlowee 009e26cb66 New version 2023-02-21 20:32:48 +01:00
tomFlowee af3618f473 Send 'mempool' to all peers
We send a 'mempool' p2p command to a peer after we did a series of
merkleblock downloads.
This code adds the mempool p2p command to be sent to peers that didn't
participate in the merkleblock download and thus get the best out of all
our connected peers.
2023-02-21 20:29:26 +01:00
tomFlowee 9e097c84b3 Upgrade deprecated 2023-02-21 14:16:43 +01:00
tomFlowee d2fa084109 Add some comments. 2023-02-20 18:16:58 +01:00
tomFlowee 67e5aaee81 Count disabled peers on load. 2023-02-20 18:15:22 +01:00
tomFlowee b702227cc4 stop using deprecated API 2023-02-13 10:38:17 +01:00
tomFlowee f7b25282a0 Add missing include statements 2023-02-06 18:10:03 +01:00
tomFlowee 3a9a45b6af Update copyright year 2023-02-05 22:40:22 +01:00
tomFlowee 6951a9f13a Add missing reserve() call 2023-01-31 20:29:51 +01:00
tomFlowee 004f957540 Revisit listener interfaces.
Now we have 3 more logically divided interfaces for the listener
pattern (callbacks).

A P2PNetInterface for peers maintainance.
A DataListenerInterface for the sections getting new data.
And last the new  HeaderSyncInterface about the state of the
header-chain (application wide).
2023-01-31 20:29:51 +01:00
tomFlowee 25477cdfa1 Add API docs. 2023-01-31 16:35:29 +01:00
tomFlowee 4f40e861f1 Remove not optional = nullptr. 2023-01-31 16:06:25 +01:00
tomFlowee 1d75226cd6 Add comments 2023-01-30 17:10:12 +01:00
tomFlowee c31ceb3c84 Add docs 2023-01-30 17:10:02 +01:00
tomFlowee e1786e0d7c Fixlet in detecting the native build 2023-01-16 11:37:03 +01:00
tomFlowee a711c38a77 Don't connect when the reconnect is underway
Avoid massive connect storm.
Using the network manager based logger we got into a fun situation where
logging to a remote host caused us to connect and fail, which caused us
to log this failed which made us try to connect and .. etc.
2022-12-20 15:32:58 +01:00
tomFlowee 68d24689a1 Modernize Qt detection code 2022-12-14 18:04:22 +01:00
tomFlowee 33986dea77 Update build-android after moving of 3rdparty libs
The main effect is we no longer build some stuff that wasn't used
anyway, so this is faster and less maintainance.
2022-12-13 11:38:59 +01:00
tomFlowee b5b493542b Rework base58 and tests
The unit tests testing base58 encoding were using univalue JSON
parsing, since we deprecatd univalue to be a hub-private lib
this has now been ported to Qts JSON parser.
Which also makes the clunky cmake hack nice to replace with the
QRC files concept.

As I was in there anyway, the base58 methods being global scope
C-style methods has now been fixed by putting them in a namespace.
2022-12-13 11:34:54 +01:00
tomFlowee 7b29af9c19 Port base58_tests from boost to QTestLib 2022-12-13 11:34:54 +01:00
tomFlowee e9563bdad0 Move univalue tests to belong to the hub tests.
As this is not actually used outside of the Hub, it really makes
more sense to make this testing part of the hub testing.
Also makes it easier to compile.
2022-12-13 11:34:54 +01:00
tomFlowee c63519fa47 Move 3rdparty libraries around.
The leveldb and univalue 3rd party libraries are not installed and
not needed by anyone outside of the Hub.
So move them there, making it easier for 3rd party usage.
2022-12-13 11:34:54 +01:00
tomFlowee 6cb5a3fe05 Update version 2022-12-08 14:19:51 +01:00
tomFlowee 7163605b00 Make sure login messages are sent first
When the client sent a message in the onConnected callback, it managed
to get in front of the login message. This fixes that.
2022-12-03 23:30:01 +01:00
tomFlowee 084aa4090f Cleanup and make nicer, cross-compile to Android.
This brings the developer experience in line with the one in Pay
and we avoid needing a path set to run the self-build executables
from.
2022-11-28 16:09:48 +01:00
tomFlowee 6de770466b Avoid possible references-of-deleted
This sanity check might avoid issues in future code by not assuming a
log channel (or anything it depends on) will avoid using logging at the
moment it is shutting down.
2022-11-25 14:01:05 +01:00
tomFlowee f3fb02a522 Make channel interface available
The manager now has an addChannel() method for anyone wanting to
implement a separate logging channel.
2022-11-24 18:14:14 +01:00
tomFlowee d8fa590547 Add useful overloads 2022-11-23 16:31:29 +01:00
Your Name 0ea51337d2 Minor fixes
Use a simple buffer on stack to read into, instead of a buffer pool.
Small fixes as well.
2022-11-14 13:15:08 +01:00
tomFlowee badfaaec0b remove stray character in message 2022-11-13 19:13:10 +01:00
tomFlowee 4b358543c5 Add unit test for partial blockchain saving. 2022-11-13 15:53:51 +01:00
tomFlowee 46c6febfa1 Make compile on CLANG 2022-11-13 12:20:23 +01:00
tomFlowee 8780f16383 Implement the compressSaveFiles method
Makes the change from yesterday complete: we now
compress all the chunks into one periodically.

This, again, is done with a timeout instead of on-close.
We have 45 seconds as a timeout to balance between need to save and
waiting long enough to get additional headers should it
have been a while since last run.
2022-11-13 12:16:26 +01:00
tomFlowee 06b3d3d491 Save the downloaded block headers into multiple files
This change makes it so that we rely less on the downloaded
blockheader data being only in memory and us saving it when
the client shuts down.
Instead, we save more regularly and we save smaller files
instead of always overwriting the complete downloaded headers.

Having less to save at shutdown is then a happy side-effect.
2022-11-12 23:42:59 +01:00
tomFlowee 64d382b7c4 Add saveData() function to p2p net 2022-11-11 19:25:19 +01:00
tomFlowee f798bf6fe5 On adding log-file output, instantly open it.
This allows this API to be used in more places and do the expected
thing.
2022-11-11 19:03:57 +01:00
tomFlowee bfda224542 Use static_cast instead. 2022-11-08 12:23:00 +01:00
tomFlowee bc51922aa6 Use new Qt for Android 2022-11-05 13:24:42 +01:00
tomFlowee 2474134058 Follow new dependencies for apt line 2022-11-05 12:20:25 +01:00
tomFlowee 8d5081df72 Remove printing version; qt6/cmake seems to have broken that. 2022-11-05 12:20:04 +01:00
tomFlowee 9e295b6f30 Port to std library equivalent. 2022-11-04 11:51:23 +01:00
tomFlowee 6c8263f50f Add comment. 2022-11-04 11:50:49 +01:00
tomFlowee f4ed75f316 Avoid auto-cast, clang didn't like it.
This avoids the code behaving differently under clang.
2022-11-04 11:49:43 +01:00
tomFlowee 126de2a231 Add new NetworkConnection::setLoginMessageCreator() 2022-11-03 23:40:31 +01:00
tomFlowee 21759ecfd7 make this work with the latest CMake 2022-10-06 22:53:09 +02:00
tomFlowee 5502724d68 Add a build script to build for Android
This uses the docker based workflow for the toolchain.
2022-09-16 17:37:45 +02:00
tomFlowee 0aa08e4e79 Fixlets to make cmake work more cross-platform. 2022-09-16 17:36:43 +02:00
tomFlowee 58afd8ab6a Make compile with older libc 2022-09-13 20:30:38 +02:00
tomFlowee de8014a568 Make compile on Android 2022-09-13 11:17:40 +02:00