scripted-diff: Rename SendMessage to SendZmqMessage.

Windows headers define SendMessage as a macro, which leads to problems
with the method name "SendMessage".  To circumvent this, we rename the
method to "SendZmqMessage".

-BEGIN VERIFY SCRIPT-
sed -i 's/SendMessage/SendZmqMessage/g' src/zmq/zmqpublishnotifier.*
-END VERIFY SCRIPT-
This commit is contained in:
Daniel Kraft committed 2020-09-15 09:38:56 +02:00
1 parent a3ffb6ebeb
commit 6fe2ef2acb
2 files changed
+6 -6

No files matched your search

+5 -5
View File
@@ -159,7 +159,7 @@ void CZMQAbstractPublishNotifier::Shutdown()
psocket = nullptr; psocket = nullptr;
} }
bool CZMQAbstractPublishNotifier::SendMessage(const char *command, const void* data, size_t size) bool CZMQAbstractPublishNotifier::SendZmqMessage(const char *command, const void* data, size_t size)
{ {
assert(psocket); assert(psocket);
@@ -183,7 +183,7 @@ bool CZMQPublishHashBlockNotifier::NotifyBlock(const CBlockIndex *pindex)
char data[32]; char data[32];
for (unsigned int i = 0; i < 32; i++) for (unsigned int i = 0; i < 32; i++)
data[31 - i] = hash.begin()[i]; data[31 - i] = hash.begin()[i];
return SendMessage(MSG_HASHBLOCK, data, 32); return SendZmqMessage(MSG_HASHBLOCK, data, 32);
} }
bool CZMQPublishHashTransactionNotifier::NotifyTransaction(const CTransaction &transaction) bool CZMQPublishHashTransactionNotifier::NotifyTransaction(const CTransaction &transaction)
@@ -193,7 +193,7 @@ bool CZMQPublishHashTransactionNotifier::NotifyTransaction(const CTransaction &t
char data[32]; char data[32];
for (unsigned int i = 0; i < 32; i++) for (unsigned int i = 0; i < 32; i++)
data[31 - i] = hash.begin()[i]; data[31 - i] = hash.begin()[i];
return SendMessage(MSG_HASHTX, data, 32); return SendZmqMessage(MSG_HASHTX, data, 32);
} }
bool CZMQPublishRawBlockNotifier::NotifyBlock(const CBlockIndex *pindex) bool CZMQPublishRawBlockNotifier::NotifyBlock(const CBlockIndex *pindex)
@@ -214,7 +214,7 @@ bool CZMQPublishRawBlockNotifier::NotifyBlock(const CBlockIndex *pindex)
ss << block; ss << block;
} }
return SendMessage(MSG_RAWBLOCK, &(*ss.begin()), ss.size()); return SendZmqMessage(MSG_RAWBLOCK, &(*ss.begin()), ss.size());
} }
bool CZMQPublishRawTransactionNotifier::NotifyTransaction(const CTransaction &transaction) bool CZMQPublishRawTransactionNotifier::NotifyTransaction(const CTransaction &transaction)
@@ -223,5 +223,5 @@ bool CZMQPublishRawTransactionNotifier::NotifyTransaction(const CTransaction &tr
LogPrint(BCLog::ZMQ, "zmq: Publish rawtx %s\n", hash.GetHex()); LogPrint(BCLog::ZMQ, "zmq: Publish rawtx %s\n", hash.GetHex());
CDataStream ss(SER_NETWORK, PROTOCOL_VERSION | RPCSerializationFlags()); CDataStream ss(SER_NETWORK, PROTOCOL_VERSION | RPCSerializationFlags());
ss << transaction; ss << transaction;
return SendMessage(MSG_RAWTX, &(*ss.begin()), ss.size()); return SendZmqMessage(MSG_RAWTX, &(*ss.begin()), ss.size());
} }
+1 -1
View File
@@ -22,7 +22,7 @@ public:
* data * data
* message sequence number * message sequence number
*/ */
bool SendMessage(const char *command, const void* data, size_t size); bool SendZmqMessage(const char *command, const void* data, size_t size);
bool Initialize(void *pcontext) override; bool Initialize(void *pcontext) override;
void Shutdown() override; void Shutdown() override;