only fetch external fee rates on mainnet

This commit is contained in:
Craig Raw 2020-11-23 17:34:19 +02:00
parent ee7b741a69
commit e14349a645

View file

@ -5,6 +5,7 @@ import com.google.common.collect.Iterables;
import com.google.common.eventbus.Subscribe; import com.google.common.eventbus.Subscribe;
import com.google.common.net.HostAndPort; import com.google.common.net.HostAndPort;
import com.sparrowwallet.drongo.KeyPurpose; import com.sparrowwallet.drongo.KeyPurpose;
import com.sparrowwallet.drongo.Network;
import com.sparrowwallet.drongo.Utils; import com.sparrowwallet.drongo.Utils;
import com.sparrowwallet.drongo.protocol.*; import com.sparrowwallet.drongo.protocol.*;
import com.sparrowwallet.drongo.wallet.*; import com.sparrowwallet.drongo.wallet.*;
@ -605,7 +606,7 @@ public class ElectrumServer {
} }
FeeRatesSource feeRatesSource = Config.get().getFeeRatesSource(); FeeRatesSource feeRatesSource = Config.get().getFeeRatesSource();
if(feeRatesSource != null) { if(feeRatesSource != null && Network.get().equals(Network.MAINNET)) {
targetBlocksFeeRatesSats.putAll(feeRatesSource.getBlockTargetFeeRates(targetBlocksFeeRatesSats)); targetBlocksFeeRatesSats.putAll(feeRatesSource.getBlockTargetFeeRates(targetBlocksFeeRatesSats));
} }