From ec3295c2c39ed30b503be8dee93ebb7a442d138f Mon Sep 17 00:00:00 2001 From: Carlos Ruz Date: Thu, 17 Oct 2024 19:51:31 -0600 Subject: [PATCH] Remove additional code for mempool.space support since their API changed and is now the same as Esplora --- sauron/sauron.py | 20 ++------------------ 1 file changed, 2 insertions(+), 18 deletions(-) diff --git a/sauron/sauron.py b/sauron/sauron.py index cb0d1b58c..1033a999e 100755 --- a/sauron/sauron.py +++ b/sauron/sauron.py @@ -46,17 +46,6 @@ def init(plugin, options, **kwargs): raise SauronError("You need to specify the sauron-api-endpoint option.") sys.exit(1) - # Testing for Esplora or mempool.space API - try: - # MutinyNet API - feerate_url = "{}/v1/fees/recommended".format(plugin.api_endpoint) - feerate_req = fetch(feerate_url) - assert feerate_req.status_code == 200 - plugin.is_mempoolspace = True - except AssertionError: - # Esplora API - plugin.is_mempoolspace = False - if options["sauron-tor-proxy"]: address, port = options["sauron-tor-proxy"].split(":") socks5_proxy = "socks5h://{}:{}".format(address, port) @@ -66,7 +55,7 @@ def init(plugin, options, **kwargs): } plugin.log("Using proxy {} for requests".format(socks5_proxy)) - api = "mempool.space" if plugin.is_mempoolspace else "Esplora" + api = "mempool.space" if "mutinynet.com" in plugin.api_endpoint else "Esplora" plugin.log(f"Sauron plugin initialized using {api} API") plugin.log(sauron_eye) @@ -200,12 +189,7 @@ def getutxout(plugin, txid, vout, **kwargs): @plugin.method("estimatefees") def estimatefees(plugin, **kwargs): - if plugin.is_mempoolspace: - # MutinyNet API - feerate_url = "{}/v1/fees/recommended".format(plugin.api_endpoint) - else: - # Blockstream API - feerate_url = "{}/fee-estimates".format(plugin.api_endpoint) + feerate_url = "{}/fee-estimates".format(plugin.api_endpoint) feerate_req = fetch(feerate_url) assert feerate_req.status_code == 200