mirror of
https://github.com/haveno-dex/haveno.git
synced 2025-06-04 13:19:03 -04:00
Extract MessageModule.BOOTSTRAP_NODE_KEY constant
This commit is contained in:
parent
05a86f251f
commit
9f2e9de94f
2 changed files with 6 additions and 2 deletions
|
@ -34,6 +34,8 @@ public abstract class MessageModule extends BitsquareModule {
|
||||||
public static final String BOOTSTRAP_NODE_PORT_KEY = "port";
|
public static final String BOOTSTRAP_NODE_PORT_KEY = "port";
|
||||||
public static final String NETWORK_INTERFACE_KEY = "networkInterface";
|
public static final String NETWORK_INTERFACE_KEY = "networkInterface";
|
||||||
|
|
||||||
|
public static final String BOOTSTRAP_NODE_KEY = "bootstrapNode";
|
||||||
|
|
||||||
protected MessageModule(Properties properties) {
|
protected MessageModule(Properties properties) {
|
||||||
super(properties);
|
super(properties);
|
||||||
}
|
}
|
||||||
|
@ -52,7 +54,7 @@ public abstract class MessageModule extends BitsquareModule {
|
||||||
);
|
);
|
||||||
|
|
||||||
bind(Node.class)
|
bind(Node.class)
|
||||||
.annotatedWith(Names.named("bootstrapNode"))
|
.annotatedWith(Names.named(BOOTSTRAP_NODE_KEY))
|
||||||
.toInstance(bootstrapNode);
|
.toInstance(bootstrapNode);
|
||||||
|
|
||||||
bind(String.class)
|
bind(String.class)
|
||||||
|
|
|
@ -68,6 +68,8 @@ import org.jetbrains.annotations.NotNull;
|
||||||
import org.slf4j.Logger;
|
import org.slf4j.Logger;
|
||||||
import org.slf4j.LoggerFactory;
|
import org.slf4j.LoggerFactory;
|
||||||
|
|
||||||
|
import static io.bitsquare.msg.MessageModule.BOOTSTRAP_NODE_KEY;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Creates a DHT peer and bootstrap to the network via a seed node
|
* Creates a DHT peer and bootstrap to the network via a seed node
|
||||||
*/
|
*/
|
||||||
|
@ -91,7 +93,7 @@ class BootstrappedPeerFactory {
|
||||||
///////////////////////////////////////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
@Inject
|
@Inject
|
||||||
public BootstrappedPeerFactory(Persistence persistence, @Named("bootstrapNode") Node bootstrapNode,
|
public BootstrappedPeerFactory(Persistence persistence, @Named(BOOTSTRAP_NODE_KEY) Node bootstrapNode,
|
||||||
@Named("networkInterface") String networkInterface) {
|
@Named("networkInterface") String networkInterface) {
|
||||||
this.persistence = persistence;
|
this.persistence = persistence;
|
||||||
this.bootstrapNode = bootstrapNode;
|
this.bootstrapNode = bootstrapNode;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue