From e5214a2ca22cecf123bcff1ab441ed0415d08a6f Mon Sep 17 00:00:00 2001 From: Lee Clagett Date: Mon, 16 Mar 2020 23:59:26 +0000 Subject: Adding ZMQ/Pub support for txpool_add and chain_main events --- src/cryptonote_core/blockchain.h | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'src/cryptonote_core/blockchain.h') diff --git a/src/cryptonote_core/blockchain.h b/src/cryptonote_core/blockchain.h index fb7e5c4f8..703dd6400 100644 --- a/src/cryptonote_core/blockchain.h +++ b/src/cryptonote_core/blockchain.h @@ -30,6 +30,7 @@ #pragma once #include +#include #include #include #include @@ -764,7 +765,7 @@ namespace cryptonote * * @param notify the notify object to call at every new block */ - void set_block_notify(const std::shared_ptr ¬ify) { m_block_notify = notify; } + void add_block_notify(boost::function)> &¬ify); /** * @brief sets a reorg notify object to call for every reorg @@ -1125,7 +1126,11 @@ namespace cryptonote bool m_batch_success; - std::shared_ptr m_block_notify; + /* `boost::function` is used because the implementation never allocates if + the callable object has a single `std::shared_ptr` or `std::weap_ptr` + internally. Whereas, the libstdc++ `std::function` will allocate. */ + + std::vector)>> m_block_notifiers; std::shared_ptr m_reorg_notify; // for prepare_handle_incoming_blocks -- cgit v1.2.3