Skip to content

Commit

Permalink
No RPC retry from mempool follower
Browse files Browse the repository at this point in the history
  • Loading branch information
Ouziel committed Jan 14, 2025
1 parent ac60794 commit 70d20e0
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
8 changes: 4 additions & 4 deletions counterparty-core/counterpartycore/lib/backend/bitcoind.py
Original file line number Diff line number Diff line change
Expand Up @@ -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 = {
Expand Down Expand Up @@ -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):
Expand Down
2 changes: 1 addition & 1 deletion counterparty-core/counterpartycore/lib/follow.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 70d20e0

Please sign in to comment.