What changed, and why it matters
This is a tiny one-line change to a unit test helper that fetches cryptocurrency exchange rates from BTCTurk. It adds an extra sanity check: it ignores any exchange rate where the bid price (what buyers are offering) is higher than the ask price (what sellers are asking), because that is an impossible/inverted market state. The commit message says it is fixing a flaky test, not a security bug.
No security action required. Treat as a normal test/quality fix.
Security signals we found
No strong security signals were identified.
Evidence from the diff
In BTCPayServer.Rating/Providers/BTCTurkRateProvider.cs, the GetRatesAsync method filters the list of returned tickers before converting them to PairRate objects. The filter was already dropping tickers with null bid or ask values; the patch additionally drops tickers where bid > ask. This prevents the downstream BidAsk constructor from receiving an invalid spread and makes a test that exercises this provider more deterministic. There is no change to authentication, authorization, input parsing, serialization, cryptography, or network handling.
Changed components
BTCPayServer.Rating/Providers/BTCTurkRateProvider.csInspect captured patch +1 / −1
### BTCPayServer.Rating/Providers/BTCTurkRateProvider.cs
@@ -30,7 +30,7 @@ public async Task<PairRate[]> GetRatesAsync(CancellationToken cancellationToken)
var jarray = (JArray)(await response.Content.ReadAsAsync<JObject>(cancellationToken))["data"];
var tickers = jarray.ToObject<Ticker[]>();
return tickers
- .Where(t => t.bid is not null && t.ask is not null)
+ .Where(t => t.bid is not null && t.ask is not null && t.bid <= t.ask)
.Select(t => new PairRate(CurrencyPair.Parse(t.pairNormalized), new BidAsk(t.bid.Value, t.ask.Value))).ToArray();
}
}Why this scored 15/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.