Commit Graph

12890 Commits

Author SHA1 Message Date
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
tomFlowee 63cc4e40ad Version 2024.10.0 2024-10-08 22:06:00 +02: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 d5ba6e19d1 Move test to its specialized file 2024-10-04 12:25:36 +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 a042cecd59 Refactor: move private class declaration to _p.h
This moves the class CBlockFileInfo from main.h to the BlocksDB_p.h
file as that is the class where it is mostly used.

There is a global variable in main.{h|cpp} left but since that is
strictly limited to main.cpp it made no sense to details slip out
via the massively overused main.h
2024-09-25 20:45:12 +02:00
tomFlowee ffeb8e059e Improve logging of libEvent
The log handler sometimes gets handed log strings that have a trailing
linefeed. Which is generated inside of the lib-event code.
To avoid these log-lines taking multiple lines in our own log, this code
removes the trailing linefeed before sending them to our own log.

Notice that as a side-effect we also limit the libevent loglines to 170
characters, which is very generous based on our tests. But this avoids a
little trust in an external library.
2024-09-25 17:18:20 +02:00
tomFlowee be89f191e9 Add todo 2024-09-16 23:18:47 +02:00
tomFlowee a674a3fb7c Change returning of 'target' to be a bytearray.
This affects both the BlockChain/GetBlockHeaderReply and the
BlockChain/GetBlockVerboseReply calls.
The field with id 75 was confusingly called 'bits', but this is really
the blocktarget from the blockheaders. We renamed this.

This field is a int-encoded-floating point value and as such it makes no
sense to send it as a simple int. It is now a byte-array.
Notice that the documentation always listed it as a byte-array so we
actually fixed the implementation to follow the spec.
2024-09-16 23:18:34 +02:00
tomFlowee ecbc199cec Remove dead code. 2024-09-16 22:34:13 +02:00
tomFlowee e5986f6199 remove unused include 2024-09-10 19:14:01 +02:00
tomFlowee 9bb8311a5f Minor clarifications.
Rename variable to talk about message instead of package (which probably
was meant to be packet anyway).
Make log message of exception we caught a little more useful.
2024-09-10 19:06:07 +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 5b209bbe1f Simplify includes 2024-09-07 18:10:13 +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 671882883c Minor linting fixes 2024-09-06 18:19:58 +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 455caa036f Fix dependency
The tests run 'hub', make sure it is compiled.
2024-09-04 22:19:54 +02:00
tomFlowee 574fb51b9f Fix logic error in dsproofstorage
This fixes the timeout not removing items from the
m_prevTxIdLookupTable.
2024-09-04 22:19:49 +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 c532227b5c Make this code aware of the new tx anatomy
Transactions can have token information before the output-script,
as such we add the filter and only go for the data we actually want.

This code is written by Telegram user @John_Galts_Gulch.
2024-09-01 21:51:18 +02:00
tomFlowee a06732f546 Add unit test for cashtoken Tx::Iterator 2024-09-01 21:51:07 +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 bcfe2f1649 Rewrite finding of config file.
To make the finding of flowee.conf and logs.conf a tad more predictable
and not random-seeming, this method is re-designed to have a clearly
defined set of fallbacks.
2024-09-01 15:59:22 +02:00
tomFlowee 1d4172d1db Remove unused includes 2024-08-31 23:09:56 +02:00
tomFlowee a3fc0aecdc Add full starting date/time loglines
Turns out, when reading through log files it is quite useful to list the
time AND date on when an app started.
Additionally, make clear that the logging is in UTC.
2024-08-26 22:04:01 +02:00