The loki.conf -> oxen.conf migration wasn't working right when there is
also a ~/.loki -> ~/.oxen migration happening, so this rewrites it to
work properly:
- Make loki.conf -> oxen.conf migration leave behind a symlink
- Fix config file migration to also look for ~/.loki/loki.conf, and also
consider ~/.loki/oxen.conf as a valid load source. (The ~/.loki
consideration only happens when data-dir is default *and* neither
oxen.conf nor loki.conf are found in ~/.oxen).
- *Don't* look for ~/.loki/{loki,oxen}.conf if the default data dir
(~/.oxen) exists.
Other changes:
- remove the default handling for the config file/log file and put it in
main instead. This is non-trivial, and the existing default is broken
in that if you specify `--data-dir=blah` it still tries to load
`~/.oxen/oxen.conf` rather than `blah/oxen.conf`. With this commit it
now does the expected thing when a data-dir is specified.
- Append /regtest to data-dir when running in --regtest mode. The
existing behaviour of clobbering the mainnet data dir is nasty.
We shouldn't actually use it in `main.cpp` because it is called before
the log system is initialized, and it is a wrapper that saves basically
nothing, so just replace it everywhere with direct calls to
fs::create_directories and delete it.
Currently stake amounts are not exposed via RPC, although they *are*
public knowledge. This adds an optional "stake_info" request field to
GET_TRANSACTIONS and GET_TRANSACTION_POOL which, if enabled, calculates
the staked amount and sets it in the response.
The wallet can occassionally become "out of sync" when a new block is
added so it becomes one block behind the chain height. This results in
errors in the wallet which are unnecessary because the user immediately
calls the function after it fails and it will succeed.
std::filesystem::rename() on windows appears buggy: it is meant to work
like POSIX rename (which atomically replaces the file if it exists), but
either mingw or Windows itself is buggy and just fails instead. Delete
manually first, on Windows.
Monero serialization reserves memory before validating the size of the
incoming data, thus allowing a remote node to send malicious data that
causes the local node to run itself out of memory.
This fixes it by limiting the amount of memory we'll reserve in advance
to a sane amount.
The loki.conf -> oxen.conf migration wasn't working right when there is
also a ~/.loki -> ~/.oxen migration happening, so this rewrites it to
work properly:
- Make loki.conf -> oxen.conf migration leave behind a symlink
- Fix config file migration to also look for ~/.loki/loki.conf, and also
consider ~/.loki/oxen.conf as a valid load source. (The ~/.loki
consideration only happens when data-dir is default *and* neither
oxen.conf nor loki.conf are found in ~/.oxen).
- *Don't* look for ~/.loki/{loki,oxen}.conf if the default data dir
(~/.oxen) exists.
Other changes:
- remove the default handling for the config file/log file and put it in
main instead. This is non-trivial, and the existing default is broken
in that if you specify `--data-dir=blah` it still tries to load
`~/.oxen/oxen.conf` rather than `blah/oxen.conf`. With this commit it
now does the expected thing when a data-dir is specified.
- Append /regtest to data-dir when running in --regtest mode. The
existing behaviour of clobbering the mainnet data dir is nasty.
We shouldn't actually use it in `main.cpp` because it is called before
the log system is initialized, and it is a wrapper that saves basically
nothing, so just replace it everywhere with direct calls to
fs::create_directories and delete it.
std::filesystem::rename() on windows appears buggy: it is meant to work
like POSIX rename (which atomically replaces the file if it exists), but
either mingw or Windows itself is buggy and just fails instead. Delete
manually first, on Windows.