mirror of
https://github.com/bisq-network/bisq.git
synced 2024-11-19 09:52:23 +01:00
Introduce NETWORK_INTERFACE_UNSPECIFIED contstant
Use an explicit value of "<unspecified>" vs. empty string ("") for clarity when the user has not specified a network interface to use.
This commit is contained in:
parent
ed76f73897
commit
85f5f02378
@ -77,6 +77,7 @@ class BootstrappedPeerFactory {
|
||||
|
||||
static final String BOOTSTRAP_NODE_KEY = "bootstrapNode";
|
||||
static final String NETWORK_INTERFACE_KEY = "networkInterface";
|
||||
static final String NETWORK_INTERFACE_UNSPECIFIED = "<unspecified>";
|
||||
|
||||
private KeyPair keyPair;
|
||||
private Storage storage;
|
||||
@ -132,7 +133,7 @@ class BootstrappedPeerFactory {
|
||||
cc.maxPermitsTCP(100);
|
||||
cc.maxPermitsUDP(100);
|
||||
Bindings bindings = new Bindings();
|
||||
if (!networkInterface.equals(""))
|
||||
if (!NETWORK_INTERFACE_UNSPECIFIED.equals(networkInterface))
|
||||
bindings.addInterface(networkInterface);
|
||||
|
||||
peer = new PeerBuilder(keyPair).ports(port).peerMap(pm).bindings(bindings)
|
||||
|
@ -25,7 +25,7 @@ import com.google.inject.name.Names;
|
||||
|
||||
import java.util.Properties;
|
||||
|
||||
import static io.bitsquare.msg.tomp2p.BootstrappedPeerFactory.BOOTSTRAP_NODE_KEY;
|
||||
import static io.bitsquare.msg.tomp2p.BootstrappedPeerFactory.*;
|
||||
import static io.bitsquare.network.BootstrapNodes.DEFAULT_BOOTSTRAP_NODE;
|
||||
|
||||
public class TomP2PMessageModule extends MessageModule {
|
||||
@ -52,7 +52,7 @@ public class TomP2PMessageModule extends MessageModule {
|
||||
)
|
||||
);
|
||||
bindConstant().annotatedWith(Names.named(NETWORK_INTERFACE_KEY)).to(
|
||||
properties.getProperty(NETWORK_INTERFACE_KEY, ""));
|
||||
properties.getProperty(NETWORK_INTERFACE_KEY, NETWORK_INTERFACE_UNSPECIFIED));
|
||||
bind(BootstrappedPeerFactory.class).asEagerSingleton();
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user