aboutsummaryrefslogtreecommitdiff
path: root/src/zmq
diff options
context:
space:
mode:
authorismaelsadeeq <ask4ismailsadiq@gmail.com>2023-11-03 17:04:30 +0100
committerismaelsadeeq <ask4ismailsadiq@gmail.com>2023-11-22 11:48:21 +0100
commitdff5ad3b9944cbb56126ba37a8da180d1327ba39 (patch)
treee09e69e7bc862ad75067046f3e023f49559d8e5d /src/zmq
parent91532bd38223d7d04166e05de11d0d0b55e60f13 (diff)
CValidationInterface: modify the parameter of `TransactionAddedToMempool`
Create a new struct `NewMempoolTransactionInfo` that will be used as the new parameter of `TransactionAddedToMempool` callback.
Diffstat (limited to 'src/zmq')
-rw-r--r--src/zmq/zmqnotificationinterface.cpp5
-rw-r--r--src/zmq/zmqnotificationinterface.h3
2 files changed, 5 insertions, 3 deletions
diff --git a/src/zmq/zmqnotificationinterface.cpp b/src/zmq/zmqnotificationinterface.cpp
index 03aae86577..63c2737706 100644
--- a/src/zmq/zmqnotificationinterface.cpp
+++ b/src/zmq/zmqnotificationinterface.cpp
@@ -6,6 +6,7 @@
#include <common/args.h>
#include <kernel/chain.h>
+#include <kernel/mempool_entry.h>
#include <logging.h>
#include <primitives/block.h>
#include <primitives/transaction.h>
@@ -152,9 +153,9 @@ void CZMQNotificationInterface::UpdatedBlockTip(const CBlockIndex *pindexNew, co
});
}
-void CZMQNotificationInterface::TransactionAddedToMempool(const CTransactionRef& ptx, uint64_t mempool_sequence)
+void CZMQNotificationInterface::TransactionAddedToMempool(const NewMempoolTransactionInfo& ptx, uint64_t mempool_sequence)
{
- const CTransaction& tx = *ptx;
+ const CTransaction& tx = *(ptx.info.m_tx);
TryForEachAndRemoveFailed(notifiers, [&tx, mempool_sequence](CZMQAbstractNotifier* notifier) {
return notifier->NotifyTransaction(tx) && notifier->NotifyTransactionAcceptance(tx, mempool_sequence);
diff --git a/src/zmq/zmqnotificationinterface.h b/src/zmq/zmqnotificationinterface.h
index 4246c53bd3..45d0982bd3 100644
--- a/src/zmq/zmqnotificationinterface.h
+++ b/src/zmq/zmqnotificationinterface.h
@@ -16,6 +16,7 @@
class CBlock;
class CBlockIndex;
class CZMQAbstractNotifier;
+struct NewMempoolTransactionInfo;
class CZMQNotificationInterface final : public CValidationInterface
{
@@ -31,7 +32,7 @@ protected:
void Shutdown();
// CValidationInterface
- void TransactionAddedToMempool(const CTransactionRef& tx, uint64_t mempool_sequence) override;
+ void TransactionAddedToMempool(const NewMempoolTransactionInfo& tx, uint64_t mempool_sequence) override;
void TransactionRemovedFromMempool(const CTransactionRef& tx, MemPoolRemovalReason reason, uint64_t mempool_sequence) override;
void BlockConnected(ChainstateRole role, const std::shared_ptr<const CBlock>& pblock, const CBlockIndex* pindexConnected) override;
void BlockDisconnected(const std::shared_ptr<const CBlock>& pblock, const CBlockIndex* pindexDisconnected) override;