435 Commits

Author SHA1 Message Date
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 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 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 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 5b5b595584 Add direct write
This allows the compiler to avoid going via std::string
2025-05-15 16:54:26 +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 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 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 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 54b4e531ef Remove unneeded text 2025-02-18 14:18:13 +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 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 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 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 312b7eafa1 Minor; use nullptr instead of 0 2025-01-06 23:30:46 +01:00
tomFlowee 9e3eeaec51 Fix fee-adjustment feature.
Adjusting the fee actually changes the transaction data and as such we
need to redo all the signatures.
This update fixes the method-structure to do this properly.
2024-10-08 19:16:08 +02:00
tomFlowee ed2bb58288 remove unused includes. 2024-10-08 13:22:41 +02:00
tomFlowee 08d79cecab Make the iterator work properly for partial tx
This allows the iterator to work properly when the number of inputs
and/or the number of outputs are zero.
2024-10-04 15:11:27 +02:00
tomFlowee 75faaf9ce1 Improve anonimized sorting to support fees and tokens
The recent features of fee adjusting an output and adding a token to an
output now also work when the transaction is sorted for bip69 style
anonimizing.
2024-10-04 15:10:06 +02:00
tomFlowee fc60f8c396 Move fee calculation into the TransactionBuilder
This adds the feature to take a transaction that has no or very low fee
and telling the TransactionBuilder class to use a certain output to
pay needed fees from.

On the call to createTransaction money will be taken from the specified
output based on the specified fee-per-byte (default 1sat/byte).
2024-10-04 12:09:55 +02:00
tomFlowee c7192dff41 Add text-limit argument to writeHex
The BufferPool::writeHex() method takes a string-pointer, we add an int
max-number-of-chars to be parsed on that string.
This allows us to not just stop at the first non-hex char, but also
after a set number of characters.

This effectively allows us to use non-zere-terminated strings as
argument too.
2024-10-03 14:07:10 +02:00
tomFlowee dd07d8540d unit test for the token API on TransactionBuilder 2024-09-07 19:38:43 +02:00
tomFlowee a85a0f7ad9 Linter tip: add assignment operator
Since there already is a copy constructor.
2024-09-07 19:38:26 +02:00
tomFlowee 135a43c625 Add implementation for building token txs
This includes a small refactor to move the writeCompactSize method
from P2PBuilder internally to a public namespace in StreamingUtils
2024-09-07 12:13:43 +02:00
tomFlowee efeb517cbd Add cashTokens API to TransactionBuilder
This allows adding, actually using the data for new transactions is
still missing.
2024-09-07 12:13:43 +02:00
tomFlowee 020e6afbd3 Improve API for the bitfield.
The CashToken bitfield now is more usable without magic numbers and we
have a bunch of documentation about what the fields mean.

Also remove unused variable.
2024-09-07 12:13:43 +02:00
tomFlowee bd4ea09582 Add docs and make p2sh API easier.
This makes the p2sh push method more sane, this takes a hash and as such
we should have a proper argument for that.
This also adds support for p2sh32.
2024-09-06 20:42:29 +02:00
tomFlowee 82e2309c2a Merge branch 'TxTokenIterator' 2024-09-06 18:19:34 +02:00
tomFlowee da8cec3147 Improve API docs comment 2024-09-05 11:52:31 +02:00
tomFlowee 1da099618d Add cashToken support to Tx::Output
This makes the Tx::nextOutput() and similar methods work properly when a
cashToken is encoutered.
For now we just add a simple bool on the output, this may be replaced
with more rich data if that turns out to be needed by the API users.
2024-09-01 21:51:35 +02:00
John Galt 9d4b32e497 Upgrade Tx::Iterator to support CashTokens
This code is written by Telegram user @John_Galts_Gulch.
2024-09-01 21:50:51 +02:00
tomFlowee 68cf4ae48f Fix ConstBuffer::indexOf constness
This method is now const, as it should be.
2024-06-11 21:34:41 +02:00
tomFlowee 6a84a262cc Add more ConstBuffer helper methods
This adds endsWith() and an extra startsWith() overload.

We also added tests for the case when either the argument or the object
are empty and specify the behavior. I copied the behavior of QString.

See unit tests that specify the behavior with empties.
2024-06-11 17:57:17 +02:00
tomFlowee 4845de2470 Add PrivateKey::fromBase58() 2024-05-01 21:55:25 +02:00
tomFlowee 4f3fd8b5bd Add support for xpriv import on HDMasterKey
This essentially adds support for a derived HDMasterKey to exist.
2024-05-01 21:54:19 +02:00
tomFlowee 2cd73ba4fb Add xpriv creation with derivation path. 2024-04-29 21:13:03 +02:00
tomFlowee 65517840ac Add level() getter 2024-04-26 16:56:44 +02:00
tomFlowee 8da1892995 Add ConstBuffer toHex() methods to get a string out. 2024-04-21 00:11:47 +02:00
tomFlowee 3e9cf0173f Add assert to avoid misuse and mem issues. 2024-04-21 00:11:07 +02:00
tomFlowee 2983c8e7a0 Add txversion getter/setter 2024-03-13 17:02:19 +01:00
tomFlowee 8a0ece8316 Doc fixes 2024-02-14 00:16:39 +01:00
tomFlowee 64fa922605 fix whitespace 2024-02-12 21:16:55 +01:00