aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWeebDataHoarder <weebdatahoarder@noreply.gammaspectra.live>2025-09-24 09:07:20 +0200
committerWeebDataHoarder <weebdatahoarder@noreply.gammaspectra.live>2025-09-24 09:22:28 +0200
commit39c7a228563a7120469369554fbd4dce92cb7eba (patch)
tree8940c95778d85b966cd2b55bcc0515acc87d12d7
parent0eaac4445efc9f25ff17e79cf3166671d2289d77 (diff)
downloadmonzero-core-39c7a228563a7120469369554fbd4dce92cb7eba.tar.gz
monzero-core-39c7a228563a7120469369554fbd4dce92cb7eba.tar.xz
monzero-core-39c7a228563a7120469369554fbd4dce92cb7eba.zip
Send ZMQ miner notifications after txpool additions
Bug was introduced in c069c04ede338929c50297558fee15192aa0f67c, before this txpool additions were not notified on block addition When receiving blocks with previously unknown conditions, miner data was sent first, but txpool add events for already-added transactions in previous block were sent afterward. Miners would then include already-mined transactions in their new templates due to receiving the mistimed txpool add event. The fix is to send miner notifications AFTER txpool events are sent, and before normal block notifications are sent (for mining switch speed purposes) Fixes c069c04ede338929c50297558fee15192aa0f67c / #9135 Fixes dfee15eee18a97be5a8fb9822527f98ebd1b33e9 / #7891
-rw-r--r--src/cryptonote_core/blockchain.cpp7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/cryptonote_core/blockchain.cpp b/src/cryptonote_core/blockchain.cpp
index 97275a462..74c87b921 100644
--- a/src/cryptonote_core/blockchain.cpp
+++ b/src/cryptonote_core/blockchain.cpp
@@ -4532,11 +4532,14 @@ leave:
}
const crypto::hash seedhash = get_block_id_by_height(crypto::rx_seedheight(new_height));
- send_miner_notifications(new_height, seedhash, id, already_generated_coins);
- // Make sure that txpool notifications happen BEFORE block notifications
+ // Make sure that txpool notifications happen BEFORE block and miner data notifications
notify_txpool_event(std::move(txpool_events));
+ // send miner notifications to switch as soon as possible
+ send_miner_notifications(new_height, seedhash, id, already_generated_coins);
+
+ // then send block notifications
for (const auto& notifier: m_block_notifiers)
notifier(new_height - 1, {std::addressof(bl), 1});