Skip to content

Commit

Permalink
Add Litecoinspace mempool provider
Browse files Browse the repository at this point in the history
  • Loading branch information
Cryp Toon committed Aug 9, 2024
1 parent c081cf8 commit 1d5e05b
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 2 deletions.
22 changes: 22 additions & 0 deletions bitcoinlib/data/providers.json
Original file line number Diff line number Diff line change
Expand Up @@ -339,5 +339,27 @@
"priority": 10,
"denominator": 1,
"network_overrides": null
},
"mempool.litecoin": {
"provider": "mempool",
"network": "litecoin_testnet",
"client_class": "MempoolClient",
"provider_coin_id": "",
"url": "https://litecoinspace.org/api/",
"api_key": "",
"priority": 11,
"denominator": 1,
"network_overrides": null
},
"mempool.litecoin_testnet": {
"provider": "mempool",
"network": "litecoin_testnet",
"client_class": "MempoolClient",
"provider_coin_id": "",
"url": "https://litecoinspace.org/testnet/api/",
"api_key": "",
"priority": 11,
"denominator": 1,
"network_overrides": null
}
}
4 changes: 2 additions & 2 deletions bitcoinlib/services/services.py
Original file line number Diff line number Diff line change
Expand Up @@ -369,7 +369,7 @@ def gettransactions(self, address, after_txid='', limit=MAX_TRANSACTIONS):

# Get (extra) transactions from service providers
txs = []
if not(db_addr and db_addr.last_block and db_addr.last_block >= self.blockcount()) or not caching_enabled:
if not (db_addr and db_addr.last_block and db_addr.last_block >= self.blockcount()) or not caching_enabled:
txs = self._provider_execute('gettransactions', address, qry_after_txid.hex(), limit)
if txs is False:
raise ServiceError("Error when retrieving transactions from service provider")
Expand All @@ -381,7 +381,7 @@ def gettransactions(self, address, after_txid='', limit=MAX_TRANSACTIONS):
# - disable cache if comparing providers or if after_txid is used and no cache is available
last_block = None
last_txid = None
if self.min_providers <= 1 and not(after_txid and not db_addr) and caching_enabled:
if self.min_providers <= 1 and not (after_txid and not db_addr) and caching_enabled:
last_block = self.blockcount()
last_txid = qry_after_txid
self.complete = True
Expand Down

0 comments on commit 1d5e05b

Please sign in to comment.