1543 Commits

Author SHA1 Message Date
tomFlowee aa7f639e79 Fix assert and add comment. 2026-05-04 21:32:08 +02:00
John Galt f1067b0744 NWM: prioritize pong replies under queue pressure
Rationale: pong responses should use the priority queue so they
are not stranded behind normal-backlog traffic.
2026-05-04 19:13:17 +02:00
tomFlowee 5bd01e0752 Fix threading issues
The binds to the executor now use the strand for more callbacks and
avoid race conditions that way.
2026-05-04 17:11:16 +02:00
tomFlowee bb36475f45 Avoid calls to throwing methods. 2026-05-04 15:45:46 +02:00
tomFlowee 69d4c03e48 Use shared from this, instead of 'this' in callbacks.
Defensive programming, really.
2026-05-04 15:29:24 +02:00
tomFlowee d71aeb7b40 Add support for p2sh32 2026-04-22 17:01:26 +02:00
tomFlowee d819e0fa4c Make p2sh address extraction work.
This now uses the proper prefix/postfix to detect a p2sh.
2026-04-22 13:28:53 +02:00
tomFlowee c3e2f98b75 Remove expensive and not used ToString() methods.
The mining code still called that, this replaces it with standard
log lines that cost less at runtime and keeps the code that is
rarely run away from the shared parts.
2026-04-20 22:45:56 +02:00
tomFlowee 0a2e552168 Move more logic over to byte-array based Block
This introduces a new BlockHeader helper class which Block and
MutableBlock can both produce, which helps a lot of methods to
be ported to no longer be dependent on us using a MutableBlock
object, which is too costly to use when we have no intention
to alter the block.
2026-04-20 22:21:18 +02:00
tomFlowee 03ec8f65aa minor textual changes 2026-04-15 00:07:09 +02:00
tomFlowee d7b46c7cea Update numbers to 2026 2026-04-15 00:07:09 +02:00
tomFlowee 900e790bf0 Avoid warning: make more =default. 2026-04-15 00:07:09 +02:00
tomFlowee 25f9e6979c Changes to use the new format
For transaction::checkTransaction():
this in practice avoids lots of mallocs and overhead while doing
transaction checks.

For merkleroot, the same benefits. Avoiding copying and mallocs.
2026-04-15 00:07:09 +02:00
tomFlowee ff4a433173 Remove dead code. 2026-04-15 00:07:09 +02:00
tomFlowee 2d0f94340f fix signed/unsigned comparisons. 2026-04-12 13:52:45 +02:00
tomFlowee 38c2e9672e Update comments and log messages. 2026-04-11 23:39:20 +02:00
tomFlowee 363153e9df Support logging line numbers and file/method names. 2026-04-11 00:26:48 +02:00
tomFlowee ef96b62937 Add calling thread ID to the log output. 2026-04-10 23:53:01 +02:00
tomFlowee df4e1de6fd Add new log channel FastLogChannel
This log channel copies the log line and instantly returns to allow the
main codebase to not have an impact on logging speed.

Normal usage this isn't really relevant, but for cases where we want a
massive amount of logging for performance tuning the logging ends up
being a bottle-neck. Well, not logging but the output channel ends up
being a IO based bottleneck.
This log channel moves the IO based work to its own thread in order
to ensure that the main code works at full speed.
2026-04-10 23:30:57 +02:00
tomFlowee 29069b5aa3 Fix error in tests. 2026-04-09 20:01:58 +02:00
tomFlowee 465aa8630d Move away from deprecated deadline_timer. 2026-04-09 19:25:27 +02:00
tomFlowee fdd9274156 Add bytesToHex helper method 2026-03-04 17:58:05 +01:00
tomFlowee efa6c05e1a A API review of CashAddr.h
This removes from the header all private methods, adds API docs and does
some renames that make code using this API much more readable.
2026-02-09 15:28:04 +01:00
tomFlowee 25eb649ac8 Start finding peers more agressively after time
Try to be closer to what the SPV action does, after calmly starting we
agressively get more new peers every cycle to compensate for the problem
that our addresses database may have lots of outdated data.
2026-02-05 13:35:42 +01:00
tomFlowee f2b59b7737 Make logging code compile with more defines
This allows compile with BCH_NO_INFO_OUTPUT define, which removes
from the compiled binary all info level logging.
2026-01-14 18:23:19 +01:00
tomFlowee fc2e2cc395 Minor cleanups 2026-01-13 21:15:00 +01:00
tomFlowee 0675f272c1 Fix sometimes reconnect not working 2026-01-08 12:05:51 +01:00
tomFlowee 1662f51193 Add more features to the http client
We parse a date/time for headers now with a specific
method that returns a QDateTime
We added a partial (incremental) download feature to avoid the need to
wait until completed. This also allows us to lower mem usage by spooling
to disk as data comes in.
2025-11-17 11:56:14 +01:00
tomFlowee ab34541a7c Skip link local networks.
As this is basically used to bind to, link local doesn't make much sense
to return.
2025-11-08 19:59:11 +01:00
tomFlowee 36b609189e Add API docs. 2025-11-05 19:24:24 +01:00
tomFlowee 23fd430264 Make SimpleHttpClient also support HEAD 2025-11-05 19:19:43 +01:00
tomFlowee 0a3ff8dfe0 Add SimpleHttpClient class
To be able to move away from the monstrosity called QtNetwork
this introduces a tiny class based on boost (headers only lib) beast.
2025-11-05 14:19:58 +01:00
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