diff --git a/data b/data index 68207a7..0116cd6 160000 --- a/data +++ b/data @@ -1 +1 @@ -Subproject commit 68207a7d95b6cb16df5c991b84ff40c25c23755b +Subproject commit 0116cd68cdfdf383823f74e0f9665a1700cf0500 diff --git a/dependencies.lock b/dependencies.lock index f52d5f2..c338e6c 100644 --- a/dependencies.lock +++ b/dependencies.lock @@ -4,6 +4,6 @@ dependencies: source: type: idf version: 4.4.7 -manifest_hash: 04e75badb795f8a851d8b088baff06d145ecf7a66457d960c2f4ede17b45ef05 +manifest_hash: cd2f3ee15e776d949eb4ea4eddc8f39b30c2a7905050850eed01ab4928143cff target: esp32s3 version: 1.0.0 diff --git a/src/lib/nostr_notify.cpp b/src/lib/nostr_notify.cpp index 7df5ea1..dda24e1 100644 --- a/src/lib/nostr_notify.cpp +++ b/src/lib/nostr_notify.cpp @@ -41,7 +41,7 @@ void setupNostrNotify(bool asDatasource, bool zapNotify) {relay}, {// First filter { - {"kinds", {"1"}}, + {"kinds", {"12203"}}, {"since", {String(getMinutesAgo(60))}}, {"authors", {pubKey}}, }}, @@ -146,6 +146,7 @@ void handleNostrEventCallback(const String &subId, nostr::SignedNostrEvent *even // Use direct value access instead of multiple comparisons String typeValue; uint medianFee = 0; + uint blockHeight = 0; for (JsonArray tag : tags) { if (tag.size() != 2) continue; @@ -166,6 +167,11 @@ void handleNostrEventCallback(const String &subId, nostr::SignedNostrEvent *even medianFee = tag[1].as(); } break; + case 'b': // blockHeight + if (strcmp(key, "block") == 0) { + blockHeight = tag[1].as(); + } + break; } } @@ -173,6 +179,10 @@ void handleNostrEventCallback(const String &subId, nostr::SignedNostrEvent *even if (!typeValue.isEmpty()) { if (typeValue == "priceUsd") { processNewPrice(obj["content"].as(), CURRENCY_USD); + if (blockHeight != 0) { + auto& blockNotify = BlockNotify::getInstance(); + blockNotify.processNewBlock(blockHeight); + } } else if (typeValue == "blockHeight") { auto& blockNotify = BlockNotify::getInstance();