Commit Graph

13024 Commits

Author SHA1 Message Date
tomFlowee 119988723f Ensure that we don't hold onto the sharedptr too long
This allows a peer we remove / ban to get deleted properly again.
2025-02-24 21:18:07 +01:00
tomFlowee 16bf019d6b Minor. Cleanup and debug outputs.
Cleans up the comments a bit, adds some logging details and as most
functional change it tweaks the numbers a little.
2025-02-24 15:53:52 +01:00
tomFlowee 412adb11ef Detect closed network listener.
This also removes the duplicate call.
2025-02-24 08:25:56 +01:00
tomFlowee a10490b7f9 Make the argument do what the docs says 2025-02-23 22:34:39 +01:00
tomFlowee 64a217df74 Use the passed in tx instead of the indirect one. 2025-02-22 16:38:59 +01:00
tomFlowee 55328ce0d7 Help binding to future interfaces
The idea of binding to interfaces now will take into account the
interfaces maybe becoming available only after the server started.

If your server starts at machine boot, it is a 50/50 chance that the
network interfaces are already fully configured and have received
addresses. In case of dhcp, more often than not this means that your
server will not be listening at the main interface because it wasn't up
yet.

This new api allows the server to give a function to register a new
interface and we have some linux specific code that will notice changes
in the interfaces and we'll allow the app to bind to it a moment or two
after that.
2025-02-20 20:37:33 +01:00
tomFlowee f2d12fd1fe Alter spv download to be parallel.
We always need two random peers to download a certain merkle block, to
avoid the withholding attack.
It occurred to me that there is no need to do them one after the other,
they can both run in parallel without issues. Saving time.
2025-02-19 19:26:56 +01:00
tomFlowee 54b4e531ef Remove unneeded text 2025-02-18 14:18:13 +01:00
tomFlowee 09cb646c1f Update to next docker release 2025-02-18 13:22:11 +01:00
tomFlowee 5874f13505 Remove unused include 2025-02-14 22:31:14 +01:00
tomFlowee 75aa7f05aa Remove outdated link 2025.02.0 2025-02-13 23:22:26 +01:00
tomFlowee 892c5a0027 Don't leave this enabled 2025-02-13 22:01:25 +01:00
tomFlowee 765955cfc0 Move release to new month 2025-02-13 21:44:44 +01:00
tomFlowee 65cc857704 Refactor and cleanup AddressMonitorService
This renames lots of variables to be more "correct" (call it
output instead of transaction and similar things).
This removes duplication by moving repeated into methods.

This fixes the behavior of the dsproof calls to be back to
the old unit test, while adding the new fields to the unit
test for minimal change.
2025-02-13 13:46:12 +01:00
John Galt ae5fc27e4f Improve AddressMonitorService
This is a combination of 5 commits.

Improve AddressMonitorService
Changed double spend notifications to new format & include cashtoken data
Updated AddressMonitorService response for txs found in the mempool.
Removed duplicate BitcoinScriptHashed tags
AddressMonitorService update
2025-02-12 16:01:19 +01:00
tomFlowee 586c0d5eef Some string usage cleanups.
Avoid unneeded conversions.
2025-02-12 15:35:41 +01:00
John Galt aa44de7d89 Change PostgreSQL so that inserts are faster (using COPY) 2025-02-12 15:35:41 +01:00
tomFlowee e4735ebd54 Post commit review of Johns CashToken stuff
This makes minor renames and cleanups.
We merge the 5 different cashtoken booleans into one, making
usage and server-code simpler.
And probably in real use not actually causing bigger messages.
2025-02-12 15:35:41 +01:00
tomFlowee a009b92c59 Revert half of Johns patch to split two features
This splits off the AddressMonitor parts from the previous commit
so we can review that separately.
2025-02-12 15:35:41 +01:00
John Galt 9942126040 Various changes made to the Flowee API to understand CashTokens and imrpove the AddressMonitorService 2025-02-12 15:35:41 +01:00
tomFlowee c083a56916 Add guards for ssl functionlity of network manager
When Boost is too old, avoid compiling the SLL features into the network
manager.
2025-02-11 20:16:32 +01:00
tomFlowee 1dc2656bef Follow ASIO porting for apps too. 2025-02-11 19:41:22 +01:00
tomFlowee 25c0ad9650 Redo the callback handling in the proxy
This makes the unit test work, specifically it ensures the callbacks are
done in the strand.
2025-02-11 19:23:14 +01:00
tomFlowee 5cae07500c Port away from deprecated ASIO methods
This makes thehub compile with BOOST_ASIO_NO_DEPRECATED defined.
2025-02-11 16:46:21 +01:00
tomFlowee 0fb5795305 Add API docs and minor fixes
Also use the more appropriate lock_guard for mutex usage.
And I noticed that in the NotificationCenter we assumed a callback would
be able to unregister itself, which requires a recursive mutex. As such
the mutex has now been elevated to be such.
2025-02-10 17:00:41 +01:00
tomFlowee bb7275466b Stop using deprecated asio io_service
This ports the io-service to the source compatible io-context
class, with the most work going to the WorkerThreads which owns
that one.
2025-02-08 19:05:26 +01:00
tomFlowee 82e698ad57 Avoid negative punishment leading to negative banscore
Negative ban scores are a bit annoying since when a user bans the node
it gives a 1000 point punishment, assuming that this will make the ban
score be above the 1000 point limit which implies banned.
2025-02-03 17:00:26 +01:00
tomFlowee 8935959c40 New release number 2025.01.1 2025-02-01 20:07:40 +01:00
tomFlowee ed93012ba6 Add extra write() helper method. 2025-01-27 20:40:24 +01:00
tomFlowee 67c69b5c56 Fix typo in comment. 2025-01-27 20:40:02 +01:00
tomFlowee 7bb45a6867 Cleanup unused LogPrint data structs 2025-01-13 23:46:29 +01:00
tomFlowee bfdd92114b Stop using deprecated method.
This does mean the minimum Qt is 6.5 for this app.
2025-01-13 23:41:23 +01:00
tomFlowee 4560355458 Introduce a different general log category. 2025-01-13 23:37:51 +01:00
tomFlowee 74d5a3f39a Allow passing in thread count. 2025-01-13 23:31:42 +01:00
tomFlowee 57ba3ffaa4 Update year and release. 2025.01.0 2025-01-07 17:06:49 +01:00
tomFlowee 09821e7dda Optimize download on testnet
Allow testnet downloads to be less secure, which makes it faster
and more reliable since there are a lot less nodes running there.
2025-01-06 23:31:19 +01:00
tomFlowee 312b7eafa1 Minor; use nullptr instead of 0 2025-01-06 23:30:46 +01:00
tomFlowee 80257ed75a Upgrade the Qt env 2024.12.0 2024-12-18 17:00:20 +01:00
tomFlowee 450384e6eb Update includes. 2024-12-04 16:04:34 +01:00
tomFlowee 8c17156dbe Trust peers longer on being on the same chain.
Instead of asking every time, we now remember and keep valid the p2p
answer for a week for a single peer.
2024-11-30 16:52:20 +01:00
tomFlowee 83be152768 Add updateBackupBlockHeight() callback
This is called whenever we have the backup peer give us a merkleblock.
2024-11-30 15:42:43 +01:00
tomFlowee 4fd2e4b3d6 Add log sections file. 2024-11-30 15:39:40 +01:00
tomFlowee 8278dc6785 This chooses the cmake boost finding behavior
CMake details for finding boost have been shipped for years inside
of boost, this makes cmake use that upsteam info to configure boost
and avoids problems when a newer boost than cmake is found.
2024-11-29 16:46:04 +01:00
tomFlowee b6fc84696a Wrap PrivacySegment in a shared pointer.
This is an abstract class that the application using this library needs
to subclass. Ownership and lifetime don't change, it still lies with the
app using the library and they still need to add and remove it from the
connectionManager, but this makes it much more stable for multi-
threading environments and avoids issues on misuse.
2024-11-29 15:12:13 +01:00
tomFlowee 88f3e65fa5 Add a callback indicating the certainty of the height
As the systems gets more peers to confirm the same current blockheight,
our certainty increases. This is now made available via a listener
callback.
2024-11-29 14:02:36 +01:00
tomFlowee 8991ccaa66 Increase minimum cmake version
Because cmake is dropping support for older versions, this then
copies the minimum version that the main thehub cmake file uses.
2024-11-28 23:03:07 +01:00
tomFlowee da4321e6a6 Minor language update 2024-10-20 12:18:21 +02:00
tomFlowee 45be0a042b Increase minimum boost version
Since the usage of registered_buffer.hpp in the network layer,
we require 1.78 (released 2021).
2024-10-14 21:18:21 +02:00
tomFlowee e9915cbcad When removing a segment, disconnect its peers
The removal of a privacySegment now makes sure that all the Peers
that reported to it are disconnected and then deleted.
2024.10.0
2024-10-11 19:44:54 +02:00
tomFlowee 4b6ca81490 Remove dead code. 2024-10-11 19:40:26 +02:00