mirror of
https://github.com/haveno-dex/haveno.git
synced 2025-08-01 03:06:14 -04:00
Clarify concept of 'default network' in BitcoinModule
This commit is contained in:
parent
c7524edef3
commit
1ea30fb4ae
1 changed files with 7 additions and 5 deletions
|
@ -30,15 +30,17 @@ import java.util.Properties;
|
||||||
|
|
||||||
public class BitcoinModule extends AbstractBitsquareModule {
|
public class BitcoinModule extends AbstractBitsquareModule {
|
||||||
|
|
||||||
private final BitcoinNetwork defaultNetwork;
|
private static final BitcoinNetwork DEFAULT_NETWORK = BitcoinNetwork.REGTEST;
|
||||||
|
|
||||||
|
private final BitcoinNetwork network;
|
||||||
|
|
||||||
public BitcoinModule(Properties properties) {
|
public BitcoinModule(Properties properties) {
|
||||||
this(properties, BitcoinNetwork.REGTEST);
|
this(properties, DEFAULT_NETWORK);
|
||||||
}
|
}
|
||||||
|
|
||||||
public BitcoinModule(Properties properties, BitcoinNetwork defaultNetwork) {
|
public BitcoinModule(Properties properties, BitcoinNetwork network) {
|
||||||
super(properties);
|
super(properties);
|
||||||
this.defaultNetwork = defaultNetwork;
|
this.network = network;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -55,7 +57,7 @@ public class BitcoinModule extends AbstractBitsquareModule {
|
||||||
}
|
}
|
||||||
|
|
||||||
private NetworkParameters network() {
|
private NetworkParameters network() {
|
||||||
String networkName = properties.getProperty("networkType", defaultNetwork.name());
|
String networkName = properties.getProperty("networkType", network.name());
|
||||||
|
|
||||||
switch (BitcoinNetwork.valueOf(networkName.toUpperCase())) {
|
switch (BitcoinNetwork.valueOf(networkName.toUpperCase())) {
|
||||||
case MAINNET:
|
case MAINNET:
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue