What changed, and why it matters
This is a bug-fix patch for Electrum's exchange-rate feature. CoinGecko began sending a 'null' price for the Honduran Lempira, which caused Electrum to crash while converting exchange rates and made the entire CoinGecko price feed unusable. The fix simply skips any currency whose value is missing. There is no security vulnerability here—just a reliability fix.
No security action needed. Treat as a normal reliability/bug-fix patch.
Security signals we found
No strong security signals were identified.
Evidence from the diff
The CoinGecko get_rates() method previously built a dictionary by calling to_decimal(d[‘value’]) for every rate entry. When CoinGecko returned {“hnl”: {“value”: null, …}}, Decimal(str(None)) raised decimal.InvalidOperation, aborting the whole update. The patch filters out entries where d.get(‘value’) is None before conversion, preventing the crash.
Changed components
electrum/exchange_rate.py - CoinGecko.get_rates()Inspect captured patch +1 / −1
diff --git a/electrum/exchange_rate.py b/electrum/exchange_rate.py
index 2f2fc45..6c75837 100644
--- a/electrum/exchange_rate.py
+++ b/electrum/exchange_rate.py
@@ -447,7 +447,7 @@ class CoinGecko(ExchangeBase):
async def get_rates(self, ccy):
json = await self.get_json('api.coingecko.com', '/api/v3/exchange_rates')
return dict([(ccy.upper(), to_decimal(d['value']))
- for ccy, d in json['rates'].items()])
+ for ccy, d in json['rates'].items() if d.get('value') is not None])
def history_ccys(self):
# CoinGecko seems to have historical data for all ccys it supports
Why this scored 21/100
Community notes
Notes can correct, qualify, or add evidence to the AI analysis. Every note shown here has been validated by a human moderator.
The AI analysis stands alone for now. Submit a note if you can add evidence or important context.