Skip to content

Commit 9a3e1a5

Browse files
committed
Merge pull request #7058
ffacd27 zmq: prepend zmq to debug messages (Daniel Cousens) 14075b1 init: add zmq to debug categories (Daniel Cousens) cdcd816 init: amend ZMQ flag names (Daniel Cousens)
2 parents f8a8e27 + ffacd27 commit 9a3e1a5

File tree

3 files changed

+12
-12
lines changed

3 files changed

+12
-12
lines changed

src/init.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -412,9 +412,9 @@ std::string HelpMessage(HelpMessageMode mode)
412412
#if ENABLE_ZMQ
413413
strUsage += HelpMessageGroup(_("ZeroMQ notification options:"));
414414
strUsage += HelpMessageOpt("-zmqpubhashblock=<address>", _("Enable publish hash block in <address>"));
415-
strUsage += HelpMessageOpt("-zmqpubhashtransaction=<address>", _("Enable publish hash transaction in <address>"));
415+
strUsage += HelpMessageOpt("-zmqpubhashtx=<address>", _("Enable publish hash transaction in <address>"));
416416
strUsage += HelpMessageOpt("-zmqpubrawblock=<address>", _("Enable publish raw block in <address>"));
417-
strUsage += HelpMessageOpt("-zmqpubrawtransaction=<address>", _("Enable publish raw transaction in <address>"));
417+
strUsage += HelpMessageOpt("-zmqpubrawtx=<address>", _("Enable publish raw transaction in <address>"));
418418
#endif
419419

420420
strUsage += HelpMessageGroup(_("Debugging/Testing options:"));
@@ -437,7 +437,7 @@ std::string HelpMessage(HelpMessageMode mode)
437437
strUsage += HelpMessageOpt("-limitdescendantcount=<n>", strprintf("Do not accept transactions if any ancestor would have <n> or more in-mempool descendants (default: %u)", DEFAULT_DESCENDANT_LIMIT));
438438
strUsage += HelpMessageOpt("-limitdescendantsize=<n>", strprintf("Do not accept transactions if any ancestor would have more than <n> kilobytes of in-mempool descendants (default: %u).", DEFAULT_DESCENDANT_SIZE_LIMIT));
439439
}
440-
string debugCategories = "addrman, alert, bench, coindb, db, lock, rand, rpc, selectcoins, mempool, mempoolrej, net, proxy, prune, http, libevent"; // Don't translate these and qt below
440+
string debugCategories = "addrman, alert, bench, coindb, db, lock, rand, rpc, selectcoins, mempool, mempoolrej, net, proxy, prune, http, libevent, zmq"; // Don't translate these and qt below
441441
if (mode == HMM_BITCOIN_QT)
442442
debugCategories += ", qt";
443443
strUsage += HelpMessageOpt("-debug=<category>", strprintf(_("Output debugging information (default: %u, supplying <category> is optional)"), 0) + ". " +
@@ -834,7 +834,7 @@ bool AppInit2(boost::thread_group& threadGroup, CScheduler& scheduler)
834834
LogPrintf("%s: parameter interaction: -blocksonly=1 -> setting -walletbroadcast=0\n", __func__);
835835
#endif
836836
}
837-
837+
838838
// Make sure enough file descriptors are available
839839
int nBind = std::max((int)mapArgs.count("-bind") + (int)mapArgs.count("-whitebind"), 1);
840840
int nUserMaxConnections = GetArg("-maxconnections", DEFAULT_MAX_PEER_CONNECTIONS);

src/zmq/zmqnotificationinterface.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212

1313
void zmqError(const char *str)
1414
{
15-
LogPrint("zmq", "Error: %s, errno=%s\n", str, zmq_strerror(errno));
15+
LogPrint("zmq", "zmq: Error: %s, errno=%s\n", str, zmq_strerror(errno));
1616
}
1717

1818
CZMQNotificationInterface::CZMQNotificationInterface() : pcontext(NULL)
@@ -72,7 +72,7 @@ CZMQNotificationInterface* CZMQNotificationInterface::CreateWithArguments(const
7272
// Called at startup to conditionally set up ZMQ socket(s)
7373
bool CZMQNotificationInterface::Initialize()
7474
{
75-
LogPrint("zmq", "Initialize notification interface\n");
75+
LogPrint("zmq", "zmq: Initialize notification interface\n");
7676
assert(!pcontext);
7777

7878
pcontext = zmq_init(1);
@@ -110,7 +110,7 @@ bool CZMQNotificationInterface::Initialize()
110110
// Called during shutdown sequence
111111
void CZMQNotificationInterface::Shutdown()
112112
{
113-
LogPrint("zmq", "Shutdown notification interface\n");
113+
LogPrint("zmq", "zmq: Shutdown notification interface\n");
114114
if (pcontext)
115115
{
116116
for (std::list<CZMQAbstractNotifier*>::iterator i=notifiers.begin(); i!=notifiers.end(); ++i)

src/zmq/zmqpublishnotifier.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ bool CZMQAbstractPublishNotifier::Initialize(void *pcontext)
7878
}
7979
else
8080
{
81-
LogPrint("zmq", " Reuse socket for address %s\n", address);
81+
LogPrint("zmq", "zmq: Reusing socket for address %s\n", address);
8282

8383
psocket = i->second->psocket;
8484
mapPublishNotifiers.insert(std::make_pair(address, this));
@@ -120,7 +120,7 @@ void CZMQAbstractPublishNotifier::Shutdown()
120120
bool CZMQPublishHashBlockNotifier::NotifyBlock(const CBlockIndex *pindex)
121121
{
122122
uint256 hash = pindex->GetBlockHash();
123-
LogPrint("zmq", "Publish hash block %s\n", hash.GetHex());
123+
LogPrint("zmq", "zmq: Publish hashblock %s\n", hash.GetHex());
124124
char data[32];
125125
for (unsigned int i = 0; i < 32; i++)
126126
data[31 - i] = hash.begin()[i];
@@ -131,7 +131,7 @@ bool CZMQPublishHashBlockNotifier::NotifyBlock(const CBlockIndex *pindex)
131131
bool CZMQPublishHashTransactionNotifier::NotifyTransaction(const CTransaction &transaction)
132132
{
133133
uint256 hash = transaction.GetHash();
134-
LogPrint("zmq", "Publish hash transaction %s\n", hash.GetHex());
134+
LogPrint("zmq", "zmq: Publish hashtx %s\n", hash.GetHex());
135135
char data[32];
136136
for (unsigned int i = 0; i < 32; i++)
137137
data[31 - i] = hash.begin()[i];
@@ -141,7 +141,7 @@ bool CZMQPublishHashTransactionNotifier::NotifyTransaction(const CTransaction &t
141141

142142
bool CZMQPublishRawBlockNotifier::NotifyBlock(const CBlockIndex *pindex)
143143
{
144-
LogPrint("zmq", "Publish raw block %s\n", pindex->GetBlockHash().GetHex());
144+
LogPrint("zmq", "zmq: Publish rawblock %s\n", pindex->GetBlockHash().GetHex());
145145

146146
const Consensus::Params& consensusParams = Params().GetConsensus();
147147
CDataStream ss(SER_NETWORK, PROTOCOL_VERSION);
@@ -164,7 +164,7 @@ bool CZMQPublishRawBlockNotifier::NotifyBlock(const CBlockIndex *pindex)
164164
bool CZMQPublishRawTransactionNotifier::NotifyTransaction(const CTransaction &transaction)
165165
{
166166
uint256 hash = transaction.GetHash();
167-
LogPrint("zmq", "Publish raw transaction %s\n", hash.GetHex());
167+
LogPrint("zmq", "zmq: Publish rawtx %s\n", hash.GetHex());
168168
CDataStream ss(SER_NETWORK, PROTOCOL_VERSION);
169169
ss << transaction;
170170
int rc = zmq_send_multipart(psocket, "rawtx", 5, &(*ss.begin()), ss.size(), 0);

0 commit comments

Comments
 (0)