This change fixes#2048 by removing the assignment of a default value
for the `baseCurrencyNetwork` option at the level of the command line
option parser. The assignment of this default was an oversight in #1961
(specifically commit 83e1dd3) that did not account for the fact that
users can change the `baseCurrencyNetwork` value via the Settings screen
in the application. When users change the setting in the application, the new
value is persisted to <appDataDir>/bisq.properties, which is handled at
runtime as a PropertySource with lower precedence than the command line
property source, which means that the changed value is never picked up
because the higher-precedence command line PropertySource always has a
default value.
This fix is surgical in that it addresses only this specific option. A
subsequent change should address the more general issue that setting
defaults in the command line option parser always precludes the
possibility of overriding them in bisq.properties. Basically, we should
revert to the previous strategy of reporting what the default value will
be in the help text without actually assigning a default value in the
option parser using the `defaultsTo` method.
In case of reorgs there are several scenarios:
1. We have no snapshot yet: We start from genesis again
2. We have a snapshot and go back to that: We use last snapshot
3. We have a snapshot but the reorg does deeper so our last block in the
snapshot is invalid as well: -> we go back to genesis
There are many edge cases
There was one important bug fix with a == instead of an equals
comparison.
Added also the check that the first block need to be the genesis block.
Unfortunately the chainHeight is set to the genesis height initially
which is not right (should be 0 as we dont have any block and therefore
no chainHeight). To change that will be a bit risky, but for mainnet we
should consider it. There are several usages where a change might break
stuff, for instance the parameter handling.
Rather than having a separate install_java.sh script for distributions
that use a different package manger, I updated install_java.sh to
handle package managers used by various Linux distributions.
On Windows, it is likely that cli-output_windows.txt will have CRLF line
endings since core.autocrlf is normally true which converts LF endings
to CRLF on checkout. This causes BisqHelpFormatterTest to fail since
the actual content it is compared against uses LF endings.
As a result, when loading the cli-output_windows.txt file normalize
line endings to LF.
- apply snapshot in case of a reorg and if the snapshot is still empty.
Set chain height to genesis height.
- Handle case if cycles are empty
- Add checks for getLast for linked lists