diff --git a/counterparty-core/counterpartycore/lib/backend/bitcoind.py b/counterparty-core/counterpartycore/lib/backend/bitcoind.py index bdb40653f..39d3fe9fb 100644 --- a/counterparty-core/counterpartycore/lib/backend/bitcoind.py +++ b/counterparty-core/counterpartycore/lib/backend/bitcoind.py @@ -137,8 +137,8 @@ def is_api_request(): return False -def rpc(method, params): - if is_api_request(): +def rpc(method, params, no_retry=False): + if is_api_request() or no_retry: return safe_rpc(method, params) payload = { @@ -199,8 +199,8 @@ def convert_to_psbt(rawtx): @functools.lru_cache(maxsize=10000) -def getrawtransaction(tx_hash, verbose=False): - return rpc("getrawtransaction", [tx_hash, 1 if verbose else 0]) +def getrawtransaction(tx_hash, verbose=False, no_retry=False): + return rpc("getrawtransaction", [tx_hash, 1 if verbose else 0], no_retry=no_retry) def getrawtransaction_batch(tx_hashes, verbose=False, return_dict=False): diff --git a/counterparty-core/counterpartycore/lib/follow.py b/counterparty-core/counterpartycore/lib/follow.py index af287d7f7..0dc17a323 100644 --- a/counterparty-core/counterpartycore/lib/follow.py +++ b/counterparty-core/counterpartycore/lib/follow.py @@ -185,7 +185,7 @@ def receive_sequence(self, body): raw_tx = self.raw_tx_cache.get(item_hash) if raw_tx is None: try: - raw_tx = backend.bitcoind.getrawtransaction(item_hash) + raw_tx = backend.bitcoind.getrawtransaction(item_hash, no_retry=True) except exceptions.BitcoindRPCError: logger.trace("Transaction not found in bitcoind: %s", item_hash) return