aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorLee Clagett <code@leeclagett.com>2026-03-06 15:55:26 -0500
committerLee *!* Clagett <code@leeclagett.com>2026-04-24 09:19:51 -0400
commit73f1eaaed6defa6fc25fc7e74b51679e365cb7e5 (patch)
tree49e80c70e7dae44956af63ec60497ad9cdd41d3a /src
parentee1bbe766317b2197510d038753be62f09c13c00 (diff)
downloadmonzero-core-73f1eaaed6defa6fc25fc7e74b51679e365cb7e5.tar.gz
monzero-core-73f1eaaed6defa6fc25fc7e74b51679e365cb7e5.tar.xz
monzero-core-73f1eaaed6defa6fc25fc7e74b51679e365cb7e5.zip
Fix ZMQ-PUB reporting of mempool txes that were initially in stem phase
Diffstat (limited to 'src')
-rw-r--r--src/cryptonote_core/cryptonote_core.cpp2
-rw-r--r--src/cryptonote_core/tx_pool.h5
2 files changed, 5 insertions, 2 deletions
diff --git a/src/cryptonote_core/cryptonote_core.cpp b/src/cryptonote_core/cryptonote_core.cpp
index 627f11450..c68d3321f 100644
--- a/src/cryptonote_core/cryptonote_core.cpp
+++ b/src/cryptonote_core/cryptonote_core.cpp
@@ -1081,7 +1081,7 @@ namespace cryptonote
const bool res = m_mempool.add_tx(tx, tx_hash, blob, tx_weight, tvc, tx_relay, relayed, version);
// If new incoming tx passed verification and entered the pool, notify ZMQ
- if (!tvc.m_verifivation_failed && tvc.m_added_to_pool && matches_category(tx_relay, relay_category::legacy))
+ if (!tvc.m_verifivation_failed && res && matches_category(tx_relay, relay_category::legacy))
{
m_blockchain_storage.notify_txpool_event({txpool_event{
.tx = tx,
diff --git a/src/cryptonote_core/tx_pool.h b/src/cryptonote_core/tx_pool.h
index ed75a3dfc..f3630368b 100644
--- a/src/cryptonote_core/tx_pool.h
+++ b/src/cryptonote_core/tx_pool.h
@@ -112,6 +112,8 @@ namespace cryptonote
* @param id the transaction's hash
* @tx_relay how the transaction was received
* @param tx_weight the transaction's weight
+ * @return True if tx passes verification checks AND is first observation
+ * of tx in `broadcasted` relay method.
*/
bool add_tx(transaction &tx, const crypto::hash &id, const cryptonote::blobdata &blob,
size_t tx_weight, tx_verification_context& tvc, relay_method tx_relay, bool relayed,
@@ -138,7 +140,8 @@ namespace cryptonote
* passes the non-input consensus tests (e.g. for newly received relayed txs), then leave
* "nic_verified_hf_version" as its default value of 0 (there is no v0 fork).
*
- * @return true if the transaction passes validations, otherwise false
+ * @return True if tx passes verification checks AND is first observation
+ * of tx in `broadcasted` relay method.
*/
bool add_tx(transaction &tx, tx_verification_context& tvc, relay_method tx_relay, bool relayed,
uint8_t version, uint8_t nic_verified_hf_version = 0);