mirror of
https://github.com/wownero/wowlet.git
synced 2026-10-20 08:38:40 +02:00
Calc: status warning
This commit is contained in:
@@ -20,6 +20,7 @@ QPointer<WebsocketNotifier> WebsocketNotifier::m_instance(nullptr);
|
||||
void WebsocketNotifier::onWSMessage(const QJsonObject &msg) {
|
||||
QString cmd = msg.value("cmd").toString();
|
||||
|
||||
m_lastMessageReceived = QDateTime::currentDateTimeUtc();
|
||||
m_cache[cmd] = msg;
|
||||
|
||||
if (cmd == "blockheights") {
|
||||
@@ -92,6 +93,10 @@ void WebsocketNotifier::emitCache() {
|
||||
}
|
||||
}
|
||||
|
||||
bool WebsocketNotifier::stale(int minutes) {
|
||||
return m_lastMessageReceived < QDateTime::currentDateTimeUtc().addSecs(-(minutes*60));
|
||||
}
|
||||
|
||||
void WebsocketNotifier::onWSNodes(const QJsonArray &nodes) {
|
||||
// TODO: Refactor, should be filtered client side
|
||||
|
||||
|
||||
Reference in New Issue
Block a user