Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Set initial value for bsqAverageTrimThreshold at update to 5% #4747

Merged
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
11 changes: 10 additions & 1 deletion core/src/main/java/bisq/core/user/Preferences.java
Expand Up @@ -245,7 +245,16 @@ private void initFromPersistedPreferences(PreferencesPayload persisted) {
setCryptoCurrencies(prefPayload.getCryptoCurrencies());
setBsqBlockChainExplorer(prefPayload.getBsqBlockChainExplorer());
GlobalSettings.setDefaultTradeCurrency(preferredTradeCurrency);
prefPayload.setBsqAverageTrimThreshold(0.05);

// If a user has updated and the field was not set and get set to 0 by protobuf
// As there is no way to detect that a primitive value field was set we cannot apply
// a "marker" value like -1 to it. We also do not want to wrap the value in a new
// proto message as thats too much for that feature... So we accept that if the user
// sets the value to 0 it will be overwritten by the default at next startup.
if (prefPayload.getBsqAverageTrimThreshold() == 0) {
prefPayload.setBsqAverageTrimThreshold(0.05);
}

setupPreferences();
}

Expand Down