From 87e7d7280739cccfabaffbbfbbbcfa21e943da3a Mon Sep 17 00:00:00 2001 From: Matt Corallo Date: Fri, 30 Sep 2016 17:40:03 -0400 Subject: Make validationinterface.UpdatedBlockTip more verbose In anticipation of making all the callbacks out of block processing flow through it. Note that vHashes will always have something in it since pindexFork != pindexNewTip. --- src/zmq/zmqnotificationinterface.cpp | 7 +++++-- src/zmq/zmqnotificationinterface.h | 2 +- 2 files changed, 6 insertions(+), 3 deletions(-) (limited to 'src/zmq') diff --git a/src/zmq/zmqnotificationinterface.cpp b/src/zmq/zmqnotificationinterface.cpp index 376e7dec59..020cdfbdc7 100644 --- a/src/zmq/zmqnotificationinterface.cpp +++ b/src/zmq/zmqnotificationinterface.cpp @@ -124,12 +124,15 @@ void CZMQNotificationInterface::Shutdown() } } -void CZMQNotificationInterface::UpdatedBlockTip(const CBlockIndex *pindex) +void CZMQNotificationInterface::UpdatedBlockTip(const CBlockIndex *pindexNew, const CBlockIndex *pindexFork, bool fInitialDownload) { + if (fInitialDownload) + return; + for (std::list::iterator i = notifiers.begin(); i!=notifiers.end(); ) { CZMQAbstractNotifier *notifier = *i; - if (notifier->NotifyBlock(pindex)) + if (notifier->NotifyBlock(pindexNew)) { i++; } diff --git a/src/zmq/zmqnotificationinterface.h b/src/zmq/zmqnotificationinterface.h index a853447267..037470ec17 100644 --- a/src/zmq/zmqnotificationinterface.h +++ b/src/zmq/zmqnotificationinterface.h @@ -25,7 +25,7 @@ protected: // CValidationInterface void SyncTransaction(const CTransaction& tx, const CBlockIndex *pindex, int posInBlock); - void UpdatedBlockTip(const CBlockIndex *pindex); + void UpdatedBlockTip(const CBlockIndex *pindexNew, const CBlockIndex *pindexFork, bool fInitialDownload); private: CZMQNotificationInterface(); -- cgit v1.2.3