Refactor BlockNotify to a class, use websocketsClient

This commit is contained in:
Djuri 2025-01-06 00:43:31 +01:00
parent ebbec75e6b
commit e330984ba2
Signed by: djuri
GPG key ID: 61B9B2DDE5AA3AC1
9 changed files with 239 additions and 257 deletions

View file

@ -131,7 +131,7 @@ namespace V2Notify
{
uint newBlockHeight = doc["blockheight"].as<uint>();
if (newBlockHeight == getBlockHeight())
if (newBlockHeight == BlockNotify::getInstance().getBlockHeight())
{
return;
}
@ -140,7 +140,7 @@ namespace V2Notify
Serial.print(F("processNewBlock "));
Serial.println(newBlockHeight);
}
processNewBlock(newBlockHeight);
BlockNotify::getInstance().processNewBlock(newBlockHeight);
}
else if (doc["blockfee"].is<uint>())
{
@ -151,7 +151,7 @@ namespace V2Notify
Serial.println(medianFee);
}
processNewBlockFee(medianFee);
BlockNotify::getInstance().processNewBlockFee(medianFee);
}
else if (doc["price"].is<JsonObject>())
{