Commit Graph

1461 Commits

Author SHA1 Message Date
tomFlowee 60e5e15542 Add more features to Mnemonic class
Also include unit tests
2025-10-28 14:52:54 +01:00
tomFlowee c79188242e Add new method to Streaming namespace
Streaming::readCompactSize()

As the reverse was already there, it makes sense to be consisten.
This includes a unit test.
2025-10-28 12:45:26 +01:00
tomFlowee 12dea93144 API docs language improvement. 2025-10-26 16:16:07 +01:00
tomFlowee 18f0405c30 Fix compile, add include. 2025-10-26 16:12:58 +01:00
tomFlowee ab4a04f176 Replace deprecated deadline_timer
Move to system timer for real world waits for most of them,
since sleeping or being suspended is local and this is networking.
2025-10-21 19:28:16 +02:00
tomFlowee 338a868f40 Add the PublicKey::verifyCompact() method
this matches the PrivateKey::signCompact and the
PublicKey::recoverCompact to handle all parts of compact (read:
recoverable) ECDSA type of signatures.
2025-10-14 22:38:54 +02:00
tomFlowee 60f54e2b46 Complete API docs 2025-10-14 00:03:24 +02:00
tomFlowee dc6fccb449 Add config file support
Reloads with SIGHUP, but we monitor the file path too, so just write is
enough.
2025-10-03 21:50:50 +02:00
tomFlowee 82f4ba87fb Fixes possible rare race condition on cancelling
Actions can be cancelled, this tries harder to avoid it continuing to
run.
2025-09-15 21:28:44 +02:00
tomFlowee bde4268202 Handle edge cases better in NetworkManager
Prevent a trivial acceptor DoS in the network layer by never shutting down
the listener due to a single bad inbound socket (or banned IP). Instead we
close just that socket and keep accepting.

In NetworkManagerServerBase::acceptConnection(tcp::socket&&), two paths that
previously called shutdown() (which closes the acceptor) now only close the
offending socket:
- When an inbound connection is from a banned IP.
- When an exception occurs while inspecting the just-accepted socket (e.g.,
remote_endpoint throws because the peer vanished).

Patch is from John Galt.
2025-08-15 13:42:35 +02:00
tomFlowee 51c24cefaf Remove unused include 2025-06-21 17:40:33 +02:00
tomFlowee 56561b4d98 Add new signal to broadcastTxData
This now also registers when a peer sends the INV.
2025-05-21 22:52:31 +02:00
tomFlowee 5b5b595584 Add direct write
This allows the compiler to avoid going via std::string
2025-05-15 16:54:26 +02:00
tomFlowee f49b5c03f5 Update to use list for walletTxIndex
Since a core feature of NotificationListener is to combine many
notification objects into one, we now changed the app-private
wallet-transaction-id to be a list instead of a singular item.
This allows the combined set of notifications to not have lost
the actual reference to the underlying individual transactions.
2025-05-07 12:43:50 +02:00
tomFlowee 409908178b Avoid a gap. 2025-05-06 15:42:52 +02:00
tomFlowee 51d77f84ad Only call onDisconnect if the connection was open 2025-05-06 12:11:25 +02:00
tomFlowee f1a975f53c Forget Id when the group is multiple items. 2025-05-06 11:58:50 +02:00
tomFlowee 32f58119a2 Add detection of being made too fat. 2025-05-06 11:58:13 +02:00
tomFlowee e1d8f700b0 Remove commented out code 2025-05-01 08:15:16 +02:00
tomFlowee 42eff37213 Remove unused count and replace it with txindex 2025-04-19 15:33:56 +02:00
tomFlowee ad1a186989 Make using bind parser easier from BufferPool 2025-04-19 15:32:58 +02:00
tomFlowee 998a4ed7ff Add uin256 bind 2025-04-15 21:40:33 +02:00
tomFlowee 4d5c934e17 Fix regression, mixup micro and milli 2025-04-14 22:20:13 +02:00
tomFlowee fddfa8e0e4 Add copyconstructor to ctransaction
It already had an assignment operator, as such the copy constructor
really should be there too.
2025-04-14 19:19:05 +02:00
tomFlowee 553568da32 Delete our connections in destructor.
When we didn't and one was still alive, it might do a callback on the
class after the destructor.
Deleting them makes the callbacks be removed on the server, avoiding
usage after free.
2025-04-14 16:36:27 +02:00
tomFlowee f764f2de78 Add new binding type. 2025-04-12 19:56:03 +02:00
tomFlowee 3c854c1ac9 Add simpler way to get data out of a message 2025-04-12 17:05:01 +02:00
tomFlowee e62b0013c3 Add new method Mnemonic::completeWords(partial) 2025-04-07 21:14:32 +02:00
tomFlowee 063816137e Implement binary search 2025-04-07 21:14:25 +02:00
tomFlowee f70adc558d Initialize it here 2025-03-10 23:33:22 +01:00
tomFlowee 49324fad28 Limit linking to only needed boost libs.
We now removed the need for Boost:chrono in all the libs, to avoid
accidentally linking to it again this change makes the apps link to
the actual specific libs instead of just all.
2025-03-07 15:36:36 +01:00
tomFlowee 5f6db1de18 Add feature: p2pnet power save mode.
Setting the "LowPower" mode on the main DownloadManager class will
cause it to halt all network activity and jobs will die.
You can revive it by changing it to NormalPower and optionally calling
the start() method to restart all jobs.
2025-03-07 14:31:02 +01:00
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 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
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 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 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 ed93012ba6 Add extra write() helper method. 2025-01-27 20:40:24 +01:00