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.
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
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.
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.
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.
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..
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.
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.
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.
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}
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}
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.
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.
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.