Commit 52d95485 authored by zeroleak's avatar zeroleak
Browse files

add min-relay-fee

parent 3edd90c5
......@@ -73,11 +73,13 @@ SCode can expire for tx0s confirmed after a specified time.
server.pools[x].anonymity-set = 5
server.pools[x].must-mix-min = 1
server.pools[x].liquidity-min = 1
server.miner-fees.min-relay-fee = 550
```
Mix will start when *anonymity-set* (mustMix + liquidities) are registered.<br/>
At the beginning of the mix, only mustMix can register up, to *anonymity-set - liquidity-min*. Meanwhile, liquidities are placed on a waiting pool.<br/>
Liquidities are added as soon as *must-mix-min* and *miner-fee-mix=(2x)miner-fee-cap* are reached, up to *anonymity-set* inputs for the mix.
Liquidities are added as soon as *must-mix-min* are reached, up to *anonymity-set* inputs for the mix.<br/>
MustMixs are selected such as accumulated miner-fees >= *min-relay-fee* and >= *must-mix-min x miner-fee-cap*
### Exports
Mixs are exported to a CSV file:
......
......@@ -3,7 +3,7 @@
<modelVersion>4.0.0</modelVersion>
<groupId>io.samourai.code.whirlpool</groupId>
<artifactId>whirlpool-server</artifactId>
<version>0.23.15</version>
<version>develop-SNAPSHOT</version>
<name>whirlpool-server</name>
<properties>
<spring-boot.version>2.1.6.RELEASE</spring-boot.version>
......
......@@ -374,7 +374,8 @@ public class WhirlpoolServerConfig extends ServerConfig {
}
public long getMinerFeeMix(MinerFeeConfig minerFeeConfig) {
return mustMixMin * minerFeeConfig.getMinerFeeMin();
return Math.max(
minerFeeConfig.getMinRelayFee(), mustMixMin * minerFeeConfig.getMinerFeeMin());
}
}
......@@ -477,6 +478,7 @@ public class WhirlpoolServerConfig extends ServerConfig {
private long minerFeeMin; // in satoshis
private long minerFeeCap; // in satoshis
private long minerFeeMax; // in satoshis
private long minRelayFee; // in satoshis
public void validate() throws Exception {
if (minerFeeMin <= 0) {
......@@ -488,6 +490,9 @@ public class WhirlpoolServerConfig extends ServerConfig {
if (minerFeeMax <= 0) {
throw new Exception("Invalid minerFeeMax");
}
if (minRelayFee <= 0) {
throw new Exception("Invalid minRelayFee");
}
}
public long getMinerFeeMin() {
......@@ -513,6 +518,14 @@ public class WhirlpoolServerConfig extends ServerConfig {
public void setMinerFeeMax(long minerFeeMax) {
this.minerFeeMax = minerFeeMax;
}
public long getMinRelayFee() {
return minRelayFee;
}
public void setMinRelayFee(long minRelayFee) {
this.minRelayFee = minRelayFee;
}
}
public static class ScodeSamouraiFeeConfig {
......@@ -613,7 +626,8 @@ public class WhirlpoolServerConfig extends ServerConfig {
+ minerFees.getMinerFeeCap()
+ ", max="
+ minerFees.getMinerFeeMax()
+ "]");
+ "], minRelayFee="
+ minerFees.getMinRelayFee());
configInfo.put(
"registerInput.maxInputsSameHash", String.valueOf(registerInput.maxInputsSameHash));
......
......@@ -19,6 +19,7 @@ server.samourai-fees.secret-wallet.passphrase = CONFIGUREME
server.miner-fees.miner-fee-min = 102
server.miner-fees.miner-fee-cap = 9500
server.miner-fees.miner-fee-max = 10000
server.miner-fees.min-relay-fee = 550
server.test-mode = false
server.request-timeout = 20000
......
......@@ -16,6 +16,7 @@ server.samourai-fees.secret-wallet.passphrase = whirlpool
server.miner-fees.miner-fee-min = 102
server.miner-fees.miner-fee-cap = 8000
server.miner-fees.miner-fee-max = 10000
server.miner-fees.min-relay-fee = 550
server.register-input.liquidity-interval = 10
......
......@@ -22,6 +22,7 @@ server.samourai-fees.secret-wallet.passphrase = whirlpool
server.miner-fees.miner-fee-min = 102
server.miner-fees.miner-fee-cap = 8000
server.miner-fees.miner-fee-max = 10000
server.miner-fees.min-relay-fee = 550
server.register-input.liquidity-interval = 2
......
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