diff --git a/core/src/main/java/bisq/core/app/CoreModule.java b/core/src/main/java/bisq/core/app/CoreModule.java index 33e94eebd07..1f058e123a7 100644 --- a/core/src/main/java/bisq/core/app/CoreModule.java +++ b/core/src/main/java/bisq/core/app/CoreModule.java @@ -47,7 +47,6 @@ import java.io.File; import static bisq.common.config.Config.*; -import static bisq.core.btc.nodes.LocalBitcoinNode.LOCAL_BITCOIN_NODE_PORT; import static com.google.inject.name.Names.named; public class CoreModule extends AppModule { @@ -78,10 +77,6 @@ protected void configure() { bindConstant().annotatedWith(named(USE_DEV_MODE)).to(config.useDevMode); bindConstant().annotatedWith(named(REFERRAL_ID)).to(config.referralId); - bindConstant().annotatedWith(named(LOCAL_BITCOIN_NODE_PORT)) - .to(config.baseCurrencyNetworkParameters.getPort()); - - // ordering is used for shut down sequence install(new TradeModule(config)); install(new EncryptionServiceModule(config)); diff --git a/core/src/main/java/bisq/core/app/misc/ModuleForAppWithP2p.java b/core/src/main/java/bisq/core/app/misc/ModuleForAppWithP2p.java index f95d8548e52..86e49bbee22 100644 --- a/core/src/main/java/bisq/core/app/misc/ModuleForAppWithP2p.java +++ b/core/src/main/java/bisq/core/app/misc/ModuleForAppWithP2p.java @@ -82,9 +82,6 @@ protected void configure() { bindConstant().annotatedWith(named(USE_DEV_MODE)).to(config.useDevMode); bindConstant().annotatedWith(named(REFERRAL_ID)).to(config.referralId); - bindConstant().annotatedWith(named(LOCAL_BITCOIN_NODE_PORT)) - .to(config.baseCurrencyNetworkParameters.getPort()); - // ordering is used for shut down sequence install(new TradeModule(config)); install(new EncryptionServiceModule(config)); diff --git a/core/src/main/java/bisq/core/btc/nodes/LocalBitcoinNode.java b/core/src/main/java/bisq/core/btc/nodes/LocalBitcoinNode.java index 414d1d2c20b..fcb250a07ae 100644 --- a/core/src/main/java/bisq/core/btc/nodes/LocalBitcoinNode.java +++ b/core/src/main/java/bisq/core/btc/nodes/LocalBitcoinNode.java @@ -12,7 +12,6 @@ import org.bitcoinj.net.NioClientManager; import javax.inject.Inject; -import javax.inject.Named; import javax.inject.Singleton; import com.google.common.util.concurrent.FutureCallback; @@ -48,8 +47,6 @@ @Singleton public class LocalBitcoinNode { - public static final String LOCAL_BITCOIN_NODE_PORT = "localBitcoinNodePort"; - private static final Logger log = LoggerFactory.getLogger(LocalBitcoinNode.class); private static final int CONNECTION_TIMEOUT = 5000; @@ -60,9 +57,9 @@ public class LocalBitcoinNode { private Boolean wellConfigured; @Inject - public LocalBitcoinNode(Config config, @Named(LOCAL_BITCOIN_NODE_PORT) int port) { + public LocalBitcoinNode(Config config) { this.config = config; - this.port = port; + this.port = config.baseCurrencyNetworkParameters.getPort(); } /** diff --git a/core/src/test/java/bisq/core/user/PreferencesTest.java b/core/src/test/java/bisq/core/user/PreferencesTest.java index fcde9455f59..b29ea9520c1 100644 --- a/core/src/test/java/bisq/core/user/PreferencesTest.java +++ b/core/src/test/java/bisq/core/user/PreferencesTest.java @@ -60,7 +60,7 @@ public void setUp() { storage = mock(Storage.class); Config config = new Config(); - LocalBitcoinNode localBitcoinNode = new LocalBitcoinNode(config, config.baseCurrencyNetworkParameters.getPort()); + LocalBitcoinNode localBitcoinNode = new LocalBitcoinNode(config); preferences = new Preferences( storage, config, localBitcoinNode, null, null, Config.DEFAULT_FULL_DAO_NODE, null, null, Config.UNSPECIFIED_PORT);