Commit Graph

37 Commits

Author SHA1 Message Date
tomFlowee 1dc2656bef Follow ASIO porting for apps too. 2025-02-11 19:41:22 +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 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 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 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
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 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 e9f89556eb Backport uPNP compile fix
This comes from Bitcoin Core commit: 8acdf6654

upnp: add compatibility for miniupnpc 2.2.8
original patch by: Cory Fields
2024-07-26 11:50:13 +02:00
tomFlowee b749d4fbe5 Minor changes 2024-04-07 20:19:46 +02:00
tomFlowee 995750fc99 Increase the requested FD count
Our database uses memmapping and each blk file allocates a file-
descriptor (FD). As such we should increase the number at the start of
the app, if we can.

Notice that the 2000 is chosen to work with a full node that still uses
tiny blk files (128 typically) instead of 1GB files as the Hub makes by
default.

Also fix a bug in the handing code. Using the hardcoded default
FD_SETSIZE made no sense there..
2024-03-28 16:16:48 +01:00
tomFlowee f84c61e187 Follow styleguide; methods start with a lowercase char. 2024-03-20 19:12:50 +01:00
tomFlowee 517a90abeb Detect too many orphans
If for some reason there are a massive amount of orphaned headers, we
don't just keep them around until they are resolved as that is
detrimental to the operation of the node.

Special case this for a reindex and simply skip all orphans fur the
duration.
2024-03-20 19:11:58 +01:00
tomFlowee f1505c0ac7 Handle a large set of metadata files better
Don't wait more than 10 seconds for missing DB data, we'll have to
conclude they won't be forthcoming and just register this in the log.
2024-03-20 19:05:38 +01:00
tomFlowee 96660d90c6 remove unused includes 2024-03-20 19:03:10 +01:00
tomFlowee 53d417e727 Allow using tiny DB files.
Doing a -reindex on a datadir of a different client gives us thousands
of small blk files, which may result in us hitting the max simultaneous
open files limit.
This change forces us to flush the list a bit more aggressively and
close open files.
2024-03-19 09:08:55 +01:00
tomFlowee bc47a700a4 Refactor; wrap BufferPool in shared_ptr
As we moved most of the creation of a BufferPool to be via the
Streaming::pool() method, which uses a thread-local, it makes sense
to start cleaning up the design and make it more modern C++.
The above mentioned method would return a reference and you'd see
loads of places use `auto &pool =` which is less than ideal.

As the number of places where we actually instantiate a BufferPool
goes down, the usage of some sort of smart pointer makes more sense.

This now makes all APIs use BufferPool be wrapped in a shared_ptr.
2023-12-21 15:23:23 +01:00
tomFlowee 2d0aec2cd7 Rename file to match class it is in
This follows the coding style guideline that the file that contains a
class should follow the exact name of this (main) class.

key.{h|cpp} -> PrivateKey.{h|cpp}
2023-11-24 22:20:40 +01:00
tomFlowee fce11e8d4f Rename file to match class it is in.
This follows the coding style guideline that the file that contains a
class should follow the exact name of this (main) class.

pubkey.{h|cpp} -> PublicKey.{h|cpp}
pubkey_utils.{h|cpp} -> PublicKeyUtils.{h|cpp}
2023-11-24 22:20:40 +01:00
tomFlowee ebaccb6fee Move include to cpp file 2023-07-15 11:36:19 +02:00
tomFlowee 3becd7aa45 Remove unused log sections and code
Decentralized all things!

But, really, don't put the logging sections for external apps in the
library code.
2023-04-04 15:47:25 +02:00
tomFlowee b702227cc4 stop using deprecated API 2023-02-13 10:38:17 +01:00
tomFlowee f7b25282a0 Add missing include statements 2023-02-06 18:10:03 +01:00
tomFlowee 2f70766091 remove useless 'throw' statements 2022-09-07 12:53:35 +02:00
tomFlowee adc1d8d3fe Support cash-addresses in cpu-mining coinbase.
Tested by mining a testnet4 block (109202)
2022-08-18 23:29:40 +02:00
tomFlowee 10f94a0e74 Fixlet in logging. 2022-08-18 23:13:35 +02:00
tomFlowee 1ab4d88993 Split version.h
Version.h held mostly stuff for protocol.h, which is a hub-specific file.
The only thing that we actually use is the PROTOCOL_VERSION in our code
and as such that one moved to the interfaces dir.
2022-07-06 22:50:53 +02:00
tomFlowee 05bbba3cb3 Rename class CKey -> PrivateKey 2022-07-06 22:12:33 +02:00
tomFlowee c9af7cca4a Rename class CPubKey -> PublicKey 2022-07-06 21:56:34 +02:00
tomFlowee c33d54ed7d Rename class CKeyID -> KeyId 2022-07-06 21:52:47 +02:00
tomFlowee c2c5fd7973 Make compile 2022-06-20 16:27:00 +02:00
tomFlowee 9fa877f425 Rename hashing methods to start with lowercase 2022-05-17 00:46:54 +02:00
tomFlowee cca8a885bc Fix coding style issues
Follow the coding styleguide and make the methods lowercase on CKey
2022-05-11 13:46:15 +02:00
tomFlowee 7b57024413 Make set() be internally consistent
setting an incorrect value should not keep the old data after we already
update the fValid boolean.
That would give the user the impression that the data was removed while
it really isn't.
2022-05-11 13:20:15 +02:00
tomFlowee b4a3da2642 The 'Server' and 'Api' dirs are not libs
These are technically static libs, but not in any way shared libs.
They are used solely only by this repo and really only by the hub.

Most important, no header files are installed and basically none of
the normal rules for reusable libraries are applied to these files.
2022-02-22 18:39:13 +01:00