Commit a596df5f authored by zeroleak's avatar zeroleak
Browse files

add tx0 fake outputs

parent f91e6950
...@@ -84,6 +84,8 @@ You can configure your own cert: ...@@ -84,6 +84,8 @@ You can configure your own cert:
| cli.requestTimeout | 30000 | HTTP requests timeout | | cli.requestTimeout | 30000 | HTTP requests timeout |
| cli.tx0MinConfirmations | 0 | Confirmations required for TX0 | | cli.tx0MinConfirmations | 0 | Confirmations required for TX0 |
| cli.mix.tx0MaxOutputs | 0 | Max premixs to create per TX0 (0 for max) | | cli.mix.tx0MaxOutputs | 0 | Max premixs to create per TX0 (0 for max) |
| cli.mix.tx0FakeOutputRandomFactor | 4 | Random factor for generating a second change output to simulate a multi-user TX0 (0=disable, 1=always, 2=1/2 probability, 3=1/3 probability...) |
| cli.mix.tx0FakeOutputMinValue | 10000 | Minimum value per change output when using TX0 fake output |
| cli.mix.clients | 5 | Max simultaneous mixing clients.<br/>(Increasing this value won't make you mix faster.) | | cli.mix.clients | 5 | Max simultaneous mixing clients.<br/>(Increasing this value won't make you mix faster.) |
| cli.mix.clientsPerPool | 1 | Max simultaneous mixing clients per pool.<br/>(Increasing this value won't make you mix faster.) | | cli.mix.clientsPerPool | 1 | Max simultaneous mixing clients per pool.<br/>(Increasing this value won't make you mix faster.) |
| cli.mix.liquidityClient | true | Enable 1 additional thread for remixing POSTMIXS simultaneously while mixing threads are busy with PREMIXS.<br/>When enabled, cli.mix.clientsPerPool may be excessed by 1. | | cli.mix.liquidityClient | true | Enable 1 additional thread for remixing POSTMIXS simultaneously while mixing threads are busy with PREMIXS.<br/>When enabled, cli.mix.clientsPerPool may be excessed by 1. |
......
...@@ -29,6 +29,9 @@ public class ApiCliConfig { ...@@ -29,6 +29,9 @@ public class ApiCliConfig {
private static final String KEY_MIX_CLIENTS_PER_POOL = "cli.mix.clientsPerPool"; private static final String KEY_MIX_CLIENTS_PER_POOL = "cli.mix.clientsPerPool";
private static final String KEY_MIX_CLIENT_DELAY = "cli.mix.clientDelay"; private static final String KEY_MIX_CLIENT_DELAY = "cli.mix.clientDelay";
private static final String KEY_MIX_TX0_MAX_OUTPUTS = "cli.mix.tx0MaxOutputs"; private static final String KEY_MIX_TX0_MAX_OUTPUTS = "cli.mix.tx0MaxOutputs";
private static final String KEY_MIX_TX0_FAKE_OUTPUT_RANDOM_FACTOR =
"cli.mix.tx0FakeOutputRandomFactor";
private static final String KEY_MIX_TX0_FAKE_OUTPUT_MIN_VALUE = "cli.mix.tx0FakeOutputMinValue";
private static final String KEY_MIX_AUTO_MIX = "cli.mix.autoMix"; private static final String KEY_MIX_AUTO_MIX = "cli.mix.autoMix";
public static final String KEY_API_HTTP_ENABLE = "cli.api.http-enable"; public static final String KEY_API_HTTP_ENABLE = "cli.api.http-enable";
...@@ -126,6 +129,8 @@ public class ApiCliConfig { ...@@ -126,6 +129,8 @@ public class ApiCliConfig {
private Integer clientsPerPool; private Integer clientsPerPool;
private Integer clientDelay; private Integer clientDelay;
private Integer tx0MaxOutputs; private Integer tx0MaxOutputs;
private Integer tx0FakeOutputRandomFactor;
private Integer tx0FakeOutputMinValue;
private Boolean autoMix; private Boolean autoMix;
public ApiMixConfig() {} public ApiMixConfig() {}
...@@ -134,6 +139,8 @@ public class ApiCliConfig { ...@@ -134,6 +139,8 @@ public class ApiCliConfig {
this.clientsPerPool = mixConfig.getClientsPerPool(); this.clientsPerPool = mixConfig.getClientsPerPool();
this.clientDelay = mixConfig.getClientDelay(); this.clientDelay = mixConfig.getClientDelay();
this.tx0MaxOutputs = mixConfig.getTx0MaxOutputs(); this.tx0MaxOutputs = mixConfig.getTx0MaxOutputs();
this.tx0FakeOutputRandomFactor = mixConfig.getTx0FakeOutputRandomFactor();
this.tx0FakeOutputMinValue = mixConfig.getTx0FakeOutputMinValue();
this.autoMix = mixConfig.isAutoMix(); this.autoMix = mixConfig.isAutoMix();
} }
...@@ -156,6 +163,13 @@ public class ApiCliConfig { ...@@ -156,6 +163,13 @@ public class ApiCliConfig {
} }
props.put(KEY_MIX_TX0_MAX_OUTPUTS, Integer.toString(tx0MaxOutputs)); props.put(KEY_MIX_TX0_MAX_OUTPUTS, Integer.toString(tx0MaxOutputs));
} }
if (tx0FakeOutputRandomFactor != null) {
props.put(
KEY_MIX_TX0_FAKE_OUTPUT_RANDOM_FACTOR, Integer.toString(tx0FakeOutputRandomFactor));
}
if (tx0FakeOutputMinValue != null) {
props.put(KEY_MIX_TX0_FAKE_OUTPUT_MIN_VALUE, Integer.toString(tx0FakeOutputMinValue));
}
if (autoMix != null) { if (autoMix != null) {
props.put(KEY_MIX_AUTO_MIX, Boolean.toString(autoMix)); props.put(KEY_MIX_AUTO_MIX, Boolean.toString(autoMix));
} }
...@@ -185,6 +199,22 @@ public class ApiCliConfig { ...@@ -185,6 +199,22 @@ public class ApiCliConfig {
this.tx0MaxOutputs = tx0MaxOutputs; this.tx0MaxOutputs = tx0MaxOutputs;
} }
public Integer getTx0FakeOutputRandomFactor() {
return tx0FakeOutputRandomFactor;
}
public void setTx0FakeOutputRandomFactor(Integer tx0FakeOutputRandomFactor) {
this.tx0FakeOutputRandomFactor = tx0FakeOutputRandomFactor;
}
public Integer getTx0FakeOutputMinValue() {
return tx0FakeOutputMinValue;
}
public void setTx0FakeOutputMinValue(Integer tx0FakeOutputMinValue) {
this.tx0FakeOutputMinValue = tx0FakeOutputMinValue;
}
public Boolean getAutoMix() { public Boolean getAutoMix() {
return autoMix; return autoMix;
} }
......
...@@ -211,6 +211,8 @@ public abstract class CliConfigFile { ...@@ -211,6 +211,8 @@ public abstract class CliConfigFile {
@NotEmpty private int clientDelay; @NotEmpty private int clientDelay;
@NotEmpty private int tx0Delay; @NotEmpty private int tx0Delay;
@NotEmpty private int tx0MaxOutputs; @NotEmpty private int tx0MaxOutputs;
@NotEmpty private int tx0FakeOutputRandomFactor;
@NotEmpty private int tx0FakeOutputMinValue;
@NotEmpty private boolean autoMix; @NotEmpty private boolean autoMix;
private Map<String, Long> overspend; private Map<String, Long> overspend;
...@@ -223,6 +225,8 @@ public abstract class CliConfigFile { ...@@ -223,6 +225,8 @@ public abstract class CliConfigFile {
this.clientDelay = copy.clientDelay; this.clientDelay = copy.clientDelay;
this.tx0Delay = copy.tx0Delay; this.tx0Delay = copy.tx0Delay;
this.tx0MaxOutputs = copy.tx0MaxOutputs; this.tx0MaxOutputs = copy.tx0MaxOutputs;
this.tx0FakeOutputRandomFactor = copy.tx0FakeOutputRandomFactor;
this.tx0FakeOutputMinValue = copy.tx0FakeOutputMinValue;
this.autoMix = copy.autoMix; this.autoMix = copy.autoMix;
this.overspend = copy.overspend != null ? new HashMap<>(copy.overspend) : null; this.overspend = copy.overspend != null ? new HashMap<>(copy.overspend) : null;
} }
...@@ -276,6 +280,22 @@ public abstract class CliConfigFile { ...@@ -276,6 +280,22 @@ public abstract class CliConfigFile {
this.tx0MaxOutputs = tx0MaxOutputs; this.tx0MaxOutputs = tx0MaxOutputs;
} }
public int getTx0FakeOutputRandomFactor() {
return tx0FakeOutputRandomFactor;
}
public void setTx0FakeOutputRandomFactor(int tx0FakeOutputRandomFactor) {
this.tx0FakeOutputRandomFactor = tx0FakeOutputRandomFactor;
}
public int getTx0FakeOutputMinValue() {
return tx0FakeOutputMinValue;
}
public void setTx0FakeOutputMinValue(int tx0FakeOutputMinValue) {
this.tx0FakeOutputMinValue = tx0FakeOutputMinValue;
}
public boolean isAutoMix() { public boolean isAutoMix() {
return autoMix; return autoMix;
} }
...@@ -300,6 +320,9 @@ public abstract class CliConfigFile { ...@@ -300,6 +320,9 @@ public abstract class CliConfigFile {
configInfo.put("cli/mix/clientDelay", Integer.toString(clientDelay)); configInfo.put("cli/mix/clientDelay", Integer.toString(clientDelay));
configInfo.put("cli/mix/tx0Delay", Integer.toString(tx0Delay)); configInfo.put("cli/mix/tx0Delay", Integer.toString(tx0Delay));
configInfo.put("cli/mix/tx0MaxOutputs", Integer.toString(tx0MaxOutputs)); configInfo.put("cli/mix/tx0MaxOutputs", Integer.toString(tx0MaxOutputs));
configInfo.put(
"cli/mix/tx0FakeOutputRandomFactor", Integer.toString(tx0FakeOutputRandomFactor));
configInfo.put("cli/mix/tx0FakeOutputMinValue", Integer.toString(tx0FakeOutputMinValue));
configInfo.put("cli/mix/autoMix", Boolean.toString(autoMix)); configInfo.put("cli/mix/autoMix", Boolean.toString(autoMix));
configInfo.put("cli/mix/overspend", overspend != null ? overspend.toString() : "null"); configInfo.put("cli/mix/overspend", overspend != null ? overspend.toString() : "null");
return configInfo; return configInfo;
...@@ -617,6 +640,8 @@ public abstract class CliConfigFile { ...@@ -617,6 +640,8 @@ public abstract class CliConfigFile {
config.setClientDelay(mix.getClientDelay()); config.setClientDelay(mix.getClientDelay());
config.setTx0Delay(mix.getTx0Delay()); config.setTx0Delay(mix.getTx0Delay());
config.setTx0MaxOutputs(mix.getTx0MaxOutputs()); config.setTx0MaxOutputs(mix.getTx0MaxOutputs());
config.setTx0FakeOutputRandomFactor(mix.getTx0FakeOutputRandomFactor());
config.setTx0FakeOutputMinValue(mix.getTx0FakeOutputMinValue());
config.setAutoMix(mix.isAutoMix()); config.setAutoMix(mix.isAutoMix());
config.setOverspend(mix.getOverspend()); config.setOverspend(mix.getOverspend());
......
...@@ -40,10 +40,12 @@ cli.mix.liquidityClient = true ...@@ -40,10 +40,12 @@ cli.mix.liquidityClient = true
cli.mix.tx0MaxOutputs = 0 cli.mix.tx0MaxOutputs = 0
cli.mix.clientDelay = 15 cli.mix.clientDelay = 15
cli.mix.tx0Delay = 30 cli.mix.tx0Delay = 30
cli.mix.tx0FakeOutputRandomFactor = 4
cli.mix.tx0FakeOutputMinValue = 10000
cli.mix.autoMix = true cli.mix.autoMix = true
cli.externalDestination.xpub= cli.externalDestination.xpub=
cli.externalDestination.chain=0 cli.externalDestination.chain=0
cli.externalDestination.startIndex=0 cli.externalDestination.startIndex=0
cli.externalDestination.mixs=0 cli.externalDestination.mixs=0
cli.externalDestination.mixsRandomFactor=2 cli.externalDestination.mixsRandomFactor=4
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment