mirror of
https://github.com/sparrowwallet/sparrow.git
synced 2024-11-04 21:36:45 +00:00
add option ot disable block explorer
This commit is contained in:
parent
dfe1f16495
commit
f22f76464a
5 changed files with 14 additions and 4 deletions
|
@ -812,6 +812,10 @@ public class AppServices {
|
|||
}
|
||||
|
||||
public static void openBlockExplorer(String txid) {
|
||||
if(Config.get().isBlockExplorerDisabled()) {
|
||||
return;
|
||||
}
|
||||
|
||||
Server blockExplorer = Config.get().getBlockExplorer() == null ? BlockExplorer.MEMPOOL_SPACE.getServer() : Config.get().getBlockExplorer();
|
||||
String url = blockExplorer.getUrl();
|
||||
if(url.contains("{0}")) {
|
||||
|
|
|
@ -151,6 +151,10 @@ public class Config {
|
|||
flush();
|
||||
}
|
||||
|
||||
public boolean isBlockExplorerDisabled() {
|
||||
return BlockExplorer.NONE.getServer().equals(blockExplorer);
|
||||
}
|
||||
|
||||
public Server getBlockExplorer() {
|
||||
return blockExplorer;
|
||||
}
|
||||
|
|
|
@ -4,7 +4,8 @@ import com.sparrowwallet.sparrow.io.Server;
|
|||
|
||||
public enum BlockExplorer {
|
||||
MEMPOOL_SPACE("https://mempool.space"),
|
||||
BLOCKSTREAM_INFO("https://blockstream.info");
|
||||
BLOCKSTREAM_INFO("https://blockstream.info"),
|
||||
NONE("http://none");
|
||||
|
||||
private final Server server;
|
||||
|
||||
|
|
|
@ -91,8 +91,8 @@ public class GeneralPreferencesController extends PreferencesDetailController {
|
|||
blockExplorers.setConverter(new StringConverter<>() {
|
||||
@Override
|
||||
public String toString(Server server) {
|
||||
if(server == null) {
|
||||
return "None Available";
|
||||
if(server == null || server == BlockExplorer.NONE.getServer()) {
|
||||
return "None";
|
||||
}
|
||||
|
||||
if(server == CUSTOM_BLOCK_EXPLORER) {
|
||||
|
|
|
@ -16,6 +16,7 @@ import com.sparrowwallet.sparrow.control.*;
|
|||
import com.sparrowwallet.sparrow.event.*;
|
||||
import com.sparrowwallet.sparrow.glyphfont.FontAwesome5;
|
||||
import com.sparrowwallet.sparrow.glyphfont.FontAwesome5Brands;
|
||||
import com.sparrowwallet.sparrow.io.Config;
|
||||
import com.sparrowwallet.sparrow.io.Device;
|
||||
import com.sparrowwallet.sparrow.net.ElectrumServer;
|
||||
import com.sparrowwallet.sparrow.io.Storage;
|
||||
|
@ -818,7 +819,7 @@ public class HeadersController extends TransactionFormController implements Init
|
|||
size.getStyleClass().remove(UNFINALIZED_TXID_CLASS);
|
||||
virtualSize.getStyleClass().remove(UNFINALIZED_TXID_CLASS);
|
||||
feeRate.getStyleClass().remove(UNFINALIZED_TXID_CLASS);
|
||||
openBlockExplorer.setDisable(false);
|
||||
openBlockExplorer.setDisable(Config.get().isBlockExplorerDisabled());
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue