From 7064f0f2fe031249f46058c7fbb88aff266f16f1 Mon Sep 17 00:00:00 2001 From: Chris Beams Date: Mon, 11 May 2020 11:26:47 +0200 Subject: [PATCH] Rename properties used to configure mempool hostnames --- .../providers/MempoolFeeRateProvider.java | 32 +++++++++---------- .../src/main/resources/application.properties | 10 +++--- 2 files changed, 21 insertions(+), 21 deletions(-) diff --git a/pricenode/src/main/java/bisq/price/mining/providers/MempoolFeeRateProvider.java b/pricenode/src/main/java/bisq/price/mining/providers/MempoolFeeRateProvider.java index e5124c1ff65..b9944d03830 100644 --- a/pricenode/src/main/java/bisq/price/mining/providers/MempoolFeeRateProvider.java +++ b/pricenode/src/main/java/bisq/price/mining/providers/MempoolFeeRateProvider.java @@ -50,13 +50,13 @@ abstract class MempoolFeeRateProvider extends FeeRateProvider { private static final int DEFAULT_MAX_BLOCKS = 2; private static final int DEFAULT_REFRESH_INTERVAL = 2; - // Keys of properties defining the available API endpoints. To enable them, simply - // uncomment and adjust the corresponding lines in application.properties - private static final String API_ENDPOINT_HOSTNAME_KEY_1 = "service.mining.feeEstimate.apiEndpointHostname.1"; - private static final String API_ENDPOINT_HOSTNAME_KEY_2 = "service.mining.feeEstimate.apiEndpointHostname.2"; - private static final String API_ENDPOINT_HOSTNAME_KEY_3 = "service.mining.feeEstimate.apiEndpointHostname.3"; - private static final String API_ENDPOINT_HOSTNAME_KEY_4 = "service.mining.feeEstimate.apiEndpointHostname.4"; - private static final String API_ENDPOINT_HOSTNAME_KEY_5 = "service.mining.feeEstimate.apiEndpointHostname.5"; + // Keys of properties defining the available Mempool API endpoints. To enable them, + // simply uncomment and adjust the corresponding lines in application.properties + private static final String MEMPOOL_HOSTNAME_KEY_1 = "bisq.price.mining.providers.mempoolHostname.1"; + private static final String MEMPOOL_HOSTNAME_KEY_2 = "bisq.price.mining.providers.mempoolHostname.2"; + private static final String MEMPOOL_HOSTNAME_KEY_3 = "bisq.price.mining.providers.mempoolHostname.3"; + private static final String MEMPOOL_HOSTNAME_KEY_4 = "bisq.price.mining.providers.mempoolHostname.4"; + private static final String MEMPOOL_HOSTNAME_KEY_5 = "bisq.price.mining.providers.mempoolHostname.5"; private static final RestTemplate restTemplate = new RestTemplate(); @@ -154,13 +154,13 @@ protected String getMempoolApiHostname() { // application.properties file, then it defaults to mempool.space // This ensures there is at least one provider attempting to connect, // even if the properties file is corrupt or empty - return env.getProperty(API_ENDPOINT_HOSTNAME_KEY_1, "mempool.space"); + return env.getProperty(MEMPOOL_HOSTNAME_KEY_1, "mempool.space"); } } @Component @Order(2) - @ConditionalOnProperty(name = API_ENDPOINT_HOSTNAME_KEY_2) + @ConditionalOnProperty(name = MEMPOOL_HOSTNAME_KEY_2) public static class Second extends MempoolFeeRateProvider { public Second(Environment env) { @@ -168,13 +168,13 @@ public Second(Environment env) { } protected String getMempoolApiHostname() { - return env.getProperty(API_ENDPOINT_HOSTNAME_KEY_2); + return env.getProperty(MEMPOOL_HOSTNAME_KEY_2); } } @Component @Order(3) - @ConditionalOnProperty(name = API_ENDPOINT_HOSTNAME_KEY_3) + @ConditionalOnProperty(name = MEMPOOL_HOSTNAME_KEY_3) public static class Third extends MempoolFeeRateProvider { public Third(Environment env) { @@ -182,13 +182,13 @@ public Third(Environment env) { } protected String getMempoolApiHostname() { - return env.getProperty(API_ENDPOINT_HOSTNAME_KEY_3); + return env.getProperty(MEMPOOL_HOSTNAME_KEY_3); } } @Component @Order(4) - @ConditionalOnProperty(name = API_ENDPOINT_HOSTNAME_KEY_4) + @ConditionalOnProperty(name = MEMPOOL_HOSTNAME_KEY_4) public static class Fourth extends MempoolFeeRateProvider { public Fourth(Environment env) { @@ -196,13 +196,13 @@ public Fourth(Environment env) { } protected String getMempoolApiHostname() { - return env.getProperty(API_ENDPOINT_HOSTNAME_KEY_4); + return env.getProperty(MEMPOOL_HOSTNAME_KEY_4); } } @Component @Order(5) - @ConditionalOnProperty(name = API_ENDPOINT_HOSTNAME_KEY_5) + @ConditionalOnProperty(name = MEMPOOL_HOSTNAME_KEY_5) public static class Fifth extends MempoolFeeRateProvider { public Fifth(Environment env) { @@ -210,7 +210,7 @@ public Fifth(Environment env) { } protected String getMempoolApiHostname() { - return env.getProperty(API_ENDPOINT_HOSTNAME_KEY_5); + return env.getProperty(MEMPOOL_HOSTNAME_KEY_5); } } diff --git a/pricenode/src/main/resources/application.properties b/pricenode/src/main/resources/application.properties index 989187e2d45..81c694ed2a3 100644 --- a/pricenode/src/main/resources/application.properties +++ b/pricenode/src/main/resources/application.properties @@ -2,8 +2,8 @@ spring.jackson.serialization.indent_output=true # To enable another fee estimation endpoint, simply uncomment one of the following lines # and set it to hostname exposing the fee estimation API -service.mining.feeEstimate.apiEndpointHostname.1=mempool.space -service.mining.feeEstimate.apiEndpointHostname.2=mempool.emzy.de -# service.mining.feeEstimate.apiEndpointHostname.3=someHostOrIP -# service.mining.feeEstimate.apiEndpointHostname.4=someHostOrIP -# service.mining.feeEstimate.apiEndpointHostname.5=someHostOrIP +bisq.price.mining.providers.mempoolHostname.1=mempool.space +bisq.price.mining.providers.mempoolHostname.2=mempool.emzy.de +# bisq.price.mining.providers.mempoolHostname.3=someHostOrIP +# bisq.price.mining.providers.mempoolHostname.4=someHostOrIP +# bisq.price.mining.providers.mempoolHostname.5=someHostOrIP