mirror of
https://github.com/logos-blockchain/lez-programs.git
synced 2026-07-23 07:19:28 +00:00
fix(amm): reject failed identity responses
This commit is contained in:
parent
7d1bef9795
commit
1f70ed51ba
@ -273,10 +273,17 @@ void AmmUiBackend::probeNetworkIdentity()
|
||||
return;
|
||||
}
|
||||
|
||||
const QByteArray payload = reply->readAll();
|
||||
const QString actual = devnet
|
||||
? channelIdFromResponse(payload)
|
||||
: blockHashFromResponse(payload);
|
||||
const QVariant statusValue = reply->attribute(
|
||||
QNetworkRequest::HttpStatusCodeAttribute);
|
||||
const int status = statusValue.toInt();
|
||||
const bool successfulResponse = reply->error() == QNetworkReply::NoError
|
||||
&& statusValue.isValid()
|
||||
&& status >= 200
|
||||
&& status < 300;
|
||||
const QByteArray payload = successfulResponse ? reply->readAll() : QByteArray();
|
||||
const QString actual = successfulResponse
|
||||
? (devnet ? channelIdFromResponse(payload) : blockHashFromResponse(payload))
|
||||
: QString();
|
||||
m_network.finishIdentityProbe(actual);
|
||||
const int retryDelay = m_network.identityRetryDelayMs();
|
||||
if (retryDelay > 0)
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user