This commit continues the complete replacement of the spaghetti code
mess that was inside daemon/ and daemonize/ which started in #1138, and
looked like a entry level Java programmer threw up inside the code base.
This greatly simplifies it, removing a whole pile of useless abstraction
layers that don't actually abstract anything, and results in
considerably simpler code. (Many of the changes here were also carried
out in #1138; this commit updates them with the merged result which
amends some things from that PR and goes further in some places).
In detail:
- the `--detach` (and related `--pidfile`) options are gone. (--detach
is still handled, but now just prints a fatal error). Detaching a
process is an archaic unix mechanism that has no place on a modern
system. If you *really* want to do it anyway, `nohup lokid &` will do
the job. (The Windows service control code, which is probably seldom
used, is kept because it seems potentially useful for Windows users).
- Many of the `t_whatever` classes in daemon/* are just deleted (mostly
done in #1138); each one was a bunch of junk code that wraps 3-4 lines
but forces an extra layer (not even a generic abstraction, just a
useless wrapper) for no good reason and made the daemon code painfully
hard to understand and work with.
- All of the remaining `t_whatever` classes in daemon/* are either
renamed to `whatever` (because prefixing every class with `t_` is
moronic).
- Some stupid related code (e.g. epee's command handler returning an
unsuitable "usage" string that has to be string modified into what we
want) was replaced with more generic, useful code.
- Replaced boost mutexes/cvs with std ones in epee command handler, and
deleted some commented out code.
- The `--public-node` option handling was terrible: it was being handled
in main, but main doesn't know anything about options, so then it
forced it through the spaghetti objects *beside* the pack of all
options that got passed along. Moved it to a more sane location
(core_rpc_server) and parse it out with some sanity.
- Changed a bunch of std::bind's to lambdas because, at least for small
lambdas (i.e. with only one-or-two pointers for captures) they will
generally be more efficient as the values can be stored in
std::function's without any memory allocations.
- Monero -> Loki
- Remove the part about attacks as checkpointing alleviates that
concern.
- Remove the recommendation about using it for confirmations, since
again checkpointing and blink make it unnecessary.
This function is broken: if it encounters a \ it stays in "escape" more
forever. However the entire function is also moronic because it is only
used in the test suite (and thus doesn't belong out of the test suite),
but is also only used for the test `--filter` arguments which have this
help message:
Regular expression filter for which tests to run
Since a glob is not a regular expression, and because passing legitimate
regular expressions through this glob_to_regex function serious breaks
them, removing this stupid broken code is actually a bug fix.
This is a big chunk of code with little usefulness: It is not the job of
Loki to tell you what operating system you are using. If someone needs
to know what OS they are on they can run `uname` themselves on anything
other than Windows, and click the Start menu in Windows.
(Contrary to the option description, this actually just tells you the
current OS, not the compiled-for OS).
This uses templates to simplify the is_yes (etc.) functions, also
removing a boost dependency and making them more flexible where callers
sometimes want "is_yes or one of these other truthy strings".
This was a useless feature to begin with. According to a Monero
insider, this was introduced at the time with an intention of making it
on-by-default on every monerod instance everywhere, but because that was
such an overwhelmingly stupid idea, it never happened yet all this code
(which is probably used by no one anywhere ever) remains in the code
base.
Even if the idea wasn't dumb to start with, this will also become even
more pointless with pulse, so just drop it (it is over 1000 lines of
code, not even counting the extra headers pulled in to do things like
querying CPU usage and battery status).
The policy needs to be set before the `link_dep_libs` function (it was
before when it was in `external`, but this started generating warnings
again when I moved it from there to the top level CMakeLists.txt).
We have never had decomposed amounts. (And I think the stuck v1
transactions are stuck precisely *because* they are v1 transactions
which are not valid decomposed amounts).
This will require a one-time change when we merge to master (to delete
the `-dev`) but after that it should just sit there without needing any
modifications on `master` or `dev`. (And letting it be specified via
cmake arguments will let me slightly simplify the debs which currently
have to add a vaguely similar patch to get the debian version into the
version string).
CMake already provides variables to handle the version major/minor/patch
if we give it the dotted version in the `project()` command. Using it
significantly reduces the amount of macro stuff we have to do in
version.cpp.in, and it seems a little nicer to have it defined in the
project top level rather than buried in a needs-to-beprocessed .cpp
file.
This moves the release codename there, too, so that it stays being
defined in essentially the same place as the version.
This change here requires some minor tweaking of the version generation
code to do it in two steps (when we have git): the first
(`src/version.cpp.in` -> `build/version.cpp.in`) replaces all the main
version variables during cmake configuration, the second
(`build/version.cpp.in` -> `build/version.cpp`) then replaces the
VERSIONTAG at build time. (Before this commit, there was only version
tag replacement that only happened at build time).
Also bumps up the version here (since I'm moving it anyway) to match
master's 7.1.8.
In Monero 12.0 the version code got rewritten and, as a result, the
variable substitution export attribute no longer applies (since
`version.cmake` got moved and renamed to `Version.cmake`), but this bit
of cruft to rewrite the release tag to "-release" and the attribute are
still there, but cannot ever be invoked.
Remove them. I specifically don't want to fix it because source exports
can come from anywhere, *not* only tagged versions, so putting
"-release" in the version string could be highly misleading.
The daemonizer requires you to fill out an "interface" to use it. This
imposes a design constraint on end users whens starting up applications
and led to a initialization circus with a t_executor starting up
a t_daemon that creates an instance of our application.
Instead design it so that execution flow is controlled by the user and
not the interface by returning the run_type that the user requested (run
as a service, forked, interactive or non-interactive) and launch
accordingly at the call site, and not indirected through 2 classes of
OOP cruft.
There still remains 1 wart with the Windows daemonizer requiring
templatization on the application so that Windows can callback at
a their deferred discretion and startup and shutdown the application
accordingly.
inconsistent results. I desk checked against the ARM64 implementation
that does NOT used the +crypto extensions, meaning it is emulated in
software- That implementation is essentially the same as the portable
implementation, some minor differences in the pre-amble but correctly
uses the light flag.
Adapting that over allows us to sync past block 321280, which previously
emitted an "unexpected difficulty" error.
This code path was never excercised due to the '-maes' flag being forced
on via CMake. That was removed in this commit to make it specifiable by
the user.
17be0ed650
- Allow show_transfers to filter by stake
- Allow combining show_transfer arguments to get a composition of
arguments specifying transfer type
- Transfer type arguments in RPC call are defaulted to true
* Updates the formatting for buying and updating LNS mappings
Previously there was no detail on the inputted information to the LNS
commands for buy and update. This commit outputs the information to the
command line for the user to review.
* Update command now queries previous LNS data
* Remove comments
* check for null on response pointer
* update if path
* Fix up scope of response