mirror of
https://github.com/bisq-network/bisq.git
synced 2024-11-19 01:41:11 +01:00
Add useFullModeDaoMonitor to options
Signed-off-by: HenrikJannsen <boilingfrog@gmx.com>
This commit is contained in:
parent
5a8c3bc5bf
commit
fd17a29361
@ -139,6 +139,7 @@ public class Config {
|
||||
public static final String BM_ORACLE_NODE_PRIV_KEY = "bmOracleNodePrivKey";
|
||||
public static final String SEED_NODE_REPORTING_SERVER_URL = "seedNodeReportingServerUrl";
|
||||
public static final String USE_TOR_FOR_BTC_MONITOR = "useTorForBtcMonitor";
|
||||
public static final String USE_FULL_MODE_DAO_MONITOR = "useFullModeDaoMonitor";
|
||||
|
||||
// Default values for certain options
|
||||
public static final int UNSPECIFIED_PORT = -1;
|
||||
@ -239,6 +240,8 @@ public class Config {
|
||||
public final String bmOracleNodePrivKey;
|
||||
public final String seedNodeReportingServerUrl;
|
||||
public final boolean useTorForBtcMonitor;
|
||||
public final boolean useFullModeDaoMonitor;
|
||||
public final boolean useFullModeDaoMonitorSetExplicitly;
|
||||
|
||||
// Properties derived from options but not exposed as options themselves
|
||||
public final File torDir;
|
||||
@ -746,6 +749,14 @@ public class Config {
|
||||
.ofType(Boolean.class)
|
||||
.defaultsTo(true);
|
||||
|
||||
ArgumentAcceptingOptionSpec<Boolean> useFullModeDaoMonitorOpt =
|
||||
parser.accepts(USE_FULL_MODE_DAO_MONITOR, "If set to true full mode DAO monitor is activated. " +
|
||||
"By that at each block during parsing the dao state hash is created, " +
|
||||
"otherwise only after block parsing is complete and on new blocks.")
|
||||
.withRequiredArg()
|
||||
.ofType(Boolean.class)
|
||||
.defaultsTo(false);
|
||||
|
||||
try {
|
||||
CompositeOptionSet options = new CompositeOptionSet();
|
||||
|
||||
@ -873,6 +884,8 @@ public class Config {
|
||||
this.bmOracleNodePrivKey = options.valueOf(bmOracleNodePrivKey);
|
||||
this.seedNodeReportingServerUrl = options.valueOf(seedNodeReportingServerUrlOpt);
|
||||
this.useTorForBtcMonitor = options.valueOf(useTorForBtcMonitorOpt);
|
||||
this.useFullModeDaoMonitor = options.valueOf(useFullModeDaoMonitorOpt);
|
||||
this.useFullModeDaoMonitorSetExplicitly = options.has(useFullModeDaoMonitorOpt);
|
||||
} catch (OptionException ex) {
|
||||
throw new ConfigException("problem parsing option '%s': %s",
|
||||
ex.options().get(0),
|
||||
|
@ -225,6 +225,7 @@ public class DaoModule extends AppModule {
|
||||
bindConstant().annotatedWith(named(Config.IS_BM_FULL_NODE)).to(config.isBmFullNode);
|
||||
bindConstant().annotatedWith(named(Config.BM_ORACLE_NODE_PUB_KEY)).to(config.bmOracleNodePubKey);
|
||||
bindConstant().annotatedWith(named(Config.BM_ORACLE_NODE_PRIV_KEY)).to(config.bmOracleNodePrivKey);
|
||||
bindConstant().annotatedWith(named(Config.USE_FULL_MODE_DAO_MONITOR)).to(config.useFullModeDaoMonitor);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -171,7 +171,7 @@ public final class Preferences implements PersistedDataHost, BridgeAddressProvid
|
||||
private final String btcNodesFromOptions, referralIdFromOptions,
|
||||
rpcUserFromOptions, rpcPwFromOptions;
|
||||
private final int blockNotifyPortFromOptions;
|
||||
private final boolean fullDaoNodeFromOptions, fullAccountingNodeFromOptions;
|
||||
private final boolean fullDaoNodeFromOptions, fullAccountingNodeFromOptions, useFullModeDaoMonitorFromOptions;
|
||||
@Getter
|
||||
private final BooleanProperty useStandbyModeProperty = new SimpleBooleanProperty(prefPayload.isUseStandbyMode());
|
||||
|
||||
@ -191,7 +191,8 @@ public final class Preferences implements PersistedDataHost, BridgeAddressProvid
|
||||
@Named(Config.IS_BM_FULL_NODE) boolean fullAccountingNode,
|
||||
@Named(Config.RPC_USER) String rpcUser,
|
||||
@Named(Config.RPC_PASSWORD) String rpcPassword,
|
||||
@Named(Config.RPC_BLOCK_NOTIFICATION_PORT) int rpcBlockNotificationPort) {
|
||||
@Named(Config.RPC_BLOCK_NOTIFICATION_PORT) int rpcBlockNotificationPort,
|
||||
@Named(Config.USE_FULL_MODE_DAO_MONITOR) boolean useFullModeDaoMonitor) {
|
||||
|
||||
this.persistenceManager = persistenceManager;
|
||||
this.config = config;
|
||||
@ -204,6 +205,7 @@ public final class Preferences implements PersistedDataHost, BridgeAddressProvid
|
||||
this.rpcUserFromOptions = rpcUser;
|
||||
this.rpcPwFromOptions = rpcPassword;
|
||||
this.blockNotifyPortFromOptions = rpcBlockNotificationPort;
|
||||
this.useFullModeDaoMonitorFromOptions = useFullModeDaoMonitor;
|
||||
|
||||
useAnimationsProperty.addListener((ov) -> {
|
||||
prefPayload.setUseAnimations(useAnimationsProperty.get());
|
||||
@ -828,9 +830,12 @@ public final class Preferences implements PersistedDataHost, BridgeAddressProvid
|
||||
}
|
||||
|
||||
public void setUseFullModeDaoMonitor(boolean value) {
|
||||
// We only persist if we have not set the program argument
|
||||
if (!config.useFullModeDaoMonitorSetExplicitly) {
|
||||
prefPayload.setUseFullModeDaoMonitor(value);
|
||||
requestPersistence();
|
||||
}
|
||||
}
|
||||
|
||||
public void setUseBitcoinUrisInQrCodes(boolean value) {
|
||||
prefPayload.setUseBitcoinUrisInQrCodes(value);
|
||||
@ -1031,6 +1036,14 @@ public final class Preferences implements PersistedDataHost, BridgeAddressProvid
|
||||
return prefPayload.isFullBMAccountingNode();
|
||||
}
|
||||
|
||||
public boolean isUseFullModeDaoMonitor() {
|
||||
if (config.useFullModeDaoMonitorSetExplicitly) {
|
||||
return useFullModeDaoMonitorFromOptions;
|
||||
} else {
|
||||
return prefPayload.isUseFullModeDaoMonitor();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////////////////
|
||||
// Private
|
||||
@ -1202,5 +1215,7 @@ public final class Preferences implements PersistedDataHost, BridgeAddressProvid
|
||||
void setProcessBurningManAccountingData(boolean processBurningManAccountingData);
|
||||
|
||||
void setFullBMAccountingNode(boolean isFullBMAccountingNode);
|
||||
|
||||
boolean isUseFullModeDaoMonitor();
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user