Skip to content

Commit c26d18c

Browse files
committed
Remove unused NotifyTransactionLock signal.
1 parent 2c9de45 commit c26d18c

8 files changed

+0
-70
lines changed

src/validationinterface.cpp

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@ struct ValidationInterfaceConnections {
1414
boost::signals2::scoped_connection TransactionAddedToMempool;
1515
boost::signals2::scoped_connection BlockConnected;
1616
boost::signals2::scoped_connection BlockDisconnected;
17-
boost::signals2::scoped_connection NotifyTransactionLock;
1817
boost::signals2::scoped_connection SetBestChain;
1918
boost::signals2::scoped_connection Broadcast;
2019
boost::signals2::scoped_connection BlockChecked;
@@ -33,8 +32,6 @@ struct MainSignalsInstance {
3332
boost::signals2::signal<void (const std::shared_ptr<const CBlock> &, const CBlockIndex *pindex, const std::vector<CTransactionRef> &)> BlockConnected;
3433
/** Notifies listeners of a block being disconnected */
3534
boost::signals2::signal<void (const std::shared_ptr<const CBlock> &, int nBlockHeight)> BlockDisconnected;
36-
/** Notifies listeners of an updated transaction lock without new data. */
37-
boost::signals2::signal<void (const CTransaction &)> NotifyTransactionLock;
3835
/** Notifies listeners of a new active block chain. */
3936
boost::signals2::signal<void (const CBlockLocator &)> SetBestChain;
4037
/** Tells listeners to broadcast their data. */
@@ -63,7 +60,6 @@ void RegisterValidationInterface(CValidationInterface* pwalletIn)
6360
conns.TransactionAddedToMempool = g_signals.m_internals->TransactionAddedToMempool.connect(std::bind(&CValidationInterface::TransactionAddedToMempool, pwalletIn, std::placeholders::_1));
6461
conns.BlockConnected = g_signals.m_internals->BlockConnected.connect(std::bind(&CValidationInterface::BlockConnected, pwalletIn, std::placeholders::_1, std::placeholders::_2, std::placeholders::_3));
6562
conns.BlockDisconnected = g_signals.m_internals->BlockDisconnected.connect(std::bind(&CValidationInterface::BlockDisconnected, pwalletIn, std::placeholders::_1, std::placeholders::_2));
66-
conns.NotifyTransactionLock = g_signals.m_internals->NotifyTransactionLock.connect(std::bind(&CValidationInterface::NotifyTransactionLock, pwalletIn, std::placeholders::_1));
6763
conns.SetBestChain = g_signals.m_internals->SetBestChain.connect(std::bind(&CValidationInterface::SetBestChain, pwalletIn, std::placeholders::_1));
6864
conns.Broadcast = g_signals.m_internals->Broadcast.connect(std::bind(&CValidationInterface::ResendWalletTransactions, pwalletIn, std::placeholders::_1));
6965
conns.BlockChecked = g_signals.m_internals->BlockChecked.connect(std::bind(&CValidationInterface::BlockChecked, pwalletIn, std::placeholders::_1, std::placeholders::_2));
@@ -100,10 +96,6 @@ void CMainSignals::BlockDisconnected(const std::shared_ptr<const CBlock> &block,
10096
m_internals->BlockDisconnected(block, nBlockHeight);
10197
}
10298

103-
void CMainSignals::NotifyTransactionLock(const CTransaction& tx) {
104-
m_internals->NotifyTransactionLock(tx);
105-
}
106-
10799
void CMainSignals::SetBestChain(const CBlockLocator& locator) {
108100
m_internals->SetBestChain(locator);
109101
}

src/validationinterface.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,6 @@ class CValidationInterface {
3535
virtual void TransactionAddedToMempool(const CTransactionRef &ptxn) {}
3636
virtual void BlockConnected(const std::shared_ptr<const CBlock> &block, const CBlockIndex *pindex, const std::vector<CTransactionRef> &txnConflicted) {}
3737
virtual void BlockDisconnected(const std::shared_ptr<const CBlock> &block, int nBlockHeight) {}
38-
virtual void NotifyTransactionLock(const CTransaction &tx) {}
3938
/** Notifies listeners of the new active block chain on-disk. */
4039
virtual void SetBestChain(const CBlockLocator &locator) {}
4140
/** Tells listeners to broadcast their data. */
@@ -61,7 +60,6 @@ class CMainSignals {
6160
void TransactionAddedToMempool(const CTransactionRef &ptxn);
6261
void BlockConnected(const std::shared_ptr<const CBlock> &block, const CBlockIndex *pindex, const std::vector<CTransactionRef> &txnConflicted);
6362
void BlockDisconnected(const std::shared_ptr<const CBlock> &block, int nBlockHeight);
64-
void NotifyTransactionLock(const CTransaction&);
6563
void SetBestChain(const CBlockLocator &);
6664
void Broadcast(CConnman* connman);
6765
void BlockChecked(const CBlock&, const CValidationState&);

src/zmq/zmqabstractnotifier.cpp

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,3 @@ bool CZMQAbstractNotifier::NotifyTransaction(const CTransaction &/*transaction*/
2121
return true;
2222
}
2323

24-
bool CZMQAbstractNotifier::NotifyTransactionLock(const CTransaction &/*transaction*/)
25-
{
26-
return true;
27-
}

src/zmq/zmqabstractnotifier.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,6 @@ class CZMQAbstractNotifier
3434

3535
virtual bool NotifyBlock(const CBlockIndex *pindex);
3636
virtual bool NotifyTransaction(const CTransaction &transaction);
37-
virtual bool NotifyTransactionLock(const CTransaction &transaction);
3837

3938
protected:
4039
void *psocket;

src/zmq/zmqnotificationinterface.cpp

Lines changed: 0 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -36,10 +36,8 @@ CZMQNotificationInterface* CZMQNotificationInterface::Create()
3636

3737
factories["pubhashblock"] = CZMQAbstractNotifier::Create<CZMQPublishHashBlockNotifier>;
3838
factories["pubhashtx"] = CZMQAbstractNotifier::Create<CZMQPublishHashTransactionNotifier>;
39-
factories["pubhashtxlock"] = CZMQAbstractNotifier::Create<CZMQPublishHashTransactionLockNotifier>;
4039
factories["pubrawblock"] = CZMQAbstractNotifier::Create<CZMQPublishRawBlockNotifier>;
4140
factories["pubrawtx"] = CZMQAbstractNotifier::Create<CZMQPublishRawTransactionNotifier>;
42-
factories["pubrawtxlock"] = CZMQAbstractNotifier::Create<CZMQPublishRawTransactionLockNotifier>;
4341

4442
for (std::map<std::string, CZMQNotifierFactory>::const_iterator i=factories.begin(); i!=factories.end(); ++i)
4543
{
@@ -181,20 +179,3 @@ void CZMQNotificationInterface::BlockDisconnected(const std::shared_ptr<const CB
181179
TransactionAddedToMempool(ptx);
182180
}
183181
}
184-
185-
void CZMQNotificationInterface::NotifyTransactionLock(const CTransaction &tx)
186-
{
187-
for (std::list<CZMQAbstractNotifier*>::iterator i = notifiers.begin(); i!=notifiers.end(); )
188-
{
189-
CZMQAbstractNotifier *notifier = *i;
190-
if (notifier->NotifyTransactionLock(tx))
191-
{
192-
i++;
193-
}
194-
else
195-
{
196-
notifier->Shutdown();
197-
i = notifiers.erase(i);
198-
}
199-
}
200-
}

src/zmq/zmqnotificationinterface.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@ class CZMQNotificationInterface : public CValidationInterface
2828
void TransactionAddedToMempool(const CTransactionRef& tx) override;
2929
void BlockConnected(const std::shared_ptr<const CBlock>& pblock, const CBlockIndex* pindexConnected, const std::vector<CTransactionRef>& vtxConflicted) override;
3030
void BlockDisconnected(const std::shared_ptr<const CBlock>& pblock, int nBlockHeight) override;
31-
void NotifyTransactionLock(const CTransaction &tx) override;
3231
void UpdatedBlockTip(const CBlockIndex *pindexNew, const CBlockIndex *pindexFork, bool fInitialDownload) override;
3332

3433
private:

src/zmq/zmqpublishnotifier.cpp

Lines changed: 0 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,8 @@ static std::multimap<std::string, CZMQAbstractPublishNotifier*> mapPublishNotifi
1313

1414
static const char *MSG_HASHBLOCK = "hashblock";
1515
static const char *MSG_HASHTX = "hashtx";
16-
static const char *MSG_HASHTXLOCK = "hashtxlock";
1716
static const char *MSG_RAWBLOCK = "rawblock";
1817
static const char *MSG_RAWTX = "rawtx";
19-
static const char *MSG_RAWTXLOCK = "rawtxlock";
2018

2119
// Internal function to send multipart message
2220
static int zmq_send_multipart(void *sock, const void* data, size_t size, ...)
@@ -164,26 +162,14 @@ bool CZMQPublishHashTransactionNotifier::NotifyTransaction(const CTransaction &t
164162
return SendMessage(MSG_HASHTX, data, 32);
165163
}
166164

167-
bool CZMQPublishHashTransactionLockNotifier::NotifyTransactionLock(const CTransaction &transaction)
168-
{
169-
uint256 hash = transaction.GetHash();
170-
LogPrint(BCLog::ZMQ, "Publish hashtxlock %s\n", hash.GetHex());
171-
char data[32];
172-
for (unsigned int i = 0; i < 32; i++)
173-
data[31 - i] = hash.begin()[i];
174-
return SendMessage(MSG_HASHTXLOCK, data, 32);
175-
}
176-
177165
bool CZMQPublishRawBlockNotifier::NotifyBlock(const CBlockIndex *pindex)
178166
{
179167
LogPrint(BCLog::ZMQ, "Publish rawblock %s\n", pindex->GetBlockHash().GetHex());
180168

181-
// XX42 const Consensus::Params& consensusParams = Params().GetConsensus();
182169
CDataStream ss(SER_NETWORK, PROTOCOL_VERSION);
183170
{
184171
LOCK(cs_main);
185172
CBlock block;
186-
// XX42 if(!ReadBlockFromDisk(block, pindex, consensusParams))
187173
if(!ReadBlockFromDisk(block, pindex))
188174
{
189175
zmqError("Can't read block from disk");
@@ -204,12 +190,3 @@ bool CZMQPublishRawTransactionNotifier::NotifyTransaction(const CTransaction &tr
204190
ss << transaction;
205191
return SendMessage(MSG_RAWTX, &(*ss.begin()), ss.size());
206192
}
207-
208-
bool CZMQPublishRawTransactionLockNotifier::NotifyTransactionLock(const CTransaction &transaction)
209-
{
210-
uint256 hash = transaction.GetHash();
211-
LogPrint(BCLog::ZMQ, "Publish rawtxlock %s\n", hash.GetHex());
212-
CDataStream ss(SER_NETWORK, PROTOCOL_VERSION);
213-
ss << transaction;
214-
return SendMessage(MSG_RAWTXLOCK, &(*ss.begin()), ss.size());
215-
}

src/zmq/zmqpublishnotifier.h

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -40,12 +40,6 @@ class CZMQPublishHashTransactionNotifier : public CZMQAbstractPublishNotifier
4040
bool NotifyTransaction(const CTransaction &transaction);
4141
};
4242

43-
class CZMQPublishHashTransactionLockNotifier : public CZMQAbstractPublishNotifier
44-
{
45-
public:
46-
bool NotifyTransactionLock(const CTransaction &transaction);
47-
};
48-
4943
class CZMQPublishRawBlockNotifier : public CZMQAbstractPublishNotifier
5044
{
5145
public:
@@ -58,10 +52,4 @@ class CZMQPublishRawTransactionNotifier : public CZMQAbstractPublishNotifier
5852
bool NotifyTransaction(const CTransaction &transaction);
5953
};
6054

61-
class CZMQPublishRawTransactionLockNotifier : public CZMQAbstractPublishNotifier
62-
{
63-
public:
64-
bool NotifyTransactionLock(const CTransaction &transaction);
65-
};
66-
6755
#endif // BITCOIN_ZMQ_ZMQPUBLISHNOTIFIER_H

0 commit comments

Comments
 (0)