From fd18a27f2df5edc0dbd65e8d24e936d9e7e5ba42 Mon Sep 17 00:00:00 2001 From: Cryp Toon Date: Tue, 17 Dec 2024 09:54:08 +0100 Subject: [PATCH] Allow to manually use disabled providers --- bitcoinlib/services/mempool.py | 1 + bitcoinlib/services/services.py | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/bitcoinlib/services/mempool.py b/bitcoinlib/services/mempool.py index d664b422..fa3bce69 100644 --- a/bitcoinlib/services/mempool.py +++ b/bitcoinlib/services/mempool.py @@ -141,6 +141,7 @@ def gettransactions(self, address, after_txid='', limit=MAX_TRANSACTIONS): if len(prtxs) > 100: break txs = [] + # FIXME: Mempool return transactions in incorrect order, this tries to fix it, but does not always work... for tx in sorted(prtxs, key=lambda x: x['status']['block_height']): t = self._parse_transaction(tx) if t: diff --git a/bitcoinlib/services/services.py b/bitcoinlib/services/services.py index a07e45de..855d9a80 100644 --- a/bitcoinlib/services/services.py +++ b/bitcoinlib/services/services.py @@ -116,7 +116,7 @@ def __init__(self, network=DEFAULT_NETWORK, min_providers=1, max_providers=1, pr for p in self.providers_defined: if ((self.providers_defined[p]['network'] == network or self.providers_defined[p]['network'] == '') and \ (not providers or self.providers_defined[p]['provider'] in providers) - and self.providers_defined[p]['priority']): + and (providers or self.providers_defined[p]['priority'])): self.providers.update({p: self.providers_defined[p]}) exclude_providers_keys = {pi: self.providers[pi]['provider'] for pi in self.providers if self.providers[pi]['provider'] in exclude_providers}.keys()