Skip to content

Commit

Permalink
scripted-diff: Rename SendMessage to SendZmqMessage.
Browse files Browse the repository at this point in the history
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-
  • Loading branch information
domob1812 committed Sep 15, 2020
1 parent a3ffb6e commit 6fe2ef2
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
10 changes: 5 additions & 5 deletions src/zmq/zmqpublishnotifier.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ void CZMQAbstractPublishNotifier::Shutdown()
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);

Expand All @@ -183,7 +183,7 @@ bool CZMQPublishHashBlockNotifier::NotifyBlock(const CBlockIndex *pindex)
char data[32];
for (unsigned int i = 0; i < 32; 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)
Expand All @@ -193,7 +193,7 @@ bool CZMQPublishHashTransactionNotifier::NotifyTransaction(const CTransaction &t
char data[32];
for (unsigned int i = 0; i < 32; 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)
Expand All @@ -214,7 +214,7 @@ bool CZMQPublishRawBlockNotifier::NotifyBlock(const CBlockIndex *pindex)
ss << block;
}

return SendMessage(MSG_RAWBLOCK, &(*ss.begin()), ss.size());
return SendZmqMessage(MSG_RAWBLOCK, &(*ss.begin()), ss.size());
}

bool CZMQPublishRawTransactionNotifier::NotifyTransaction(const CTransaction &transaction)
Expand All @@ -223,5 +223,5 @@ bool CZMQPublishRawTransactionNotifier::NotifyTransaction(const CTransaction &tr
LogPrint(BCLog::ZMQ, "zmq: Publish rawtx %s\n", hash.GetHex());
CDataStream ss(SER_NETWORK, PROTOCOL_VERSION | RPCSerializationFlags());
ss << transaction;
return SendMessage(MSG_RAWTX, &(*ss.begin()), ss.size());
return SendZmqMessage(MSG_RAWTX, &(*ss.begin()), ss.size());
}
2 changes: 1 addition & 1 deletion src/zmq/zmqpublishnotifier.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ class CZMQAbstractPublishNotifier : public CZMQAbstractNotifier
* data
* 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;
void Shutdown() override;
Expand Down

0 comments on commit 6fe2ef2

Please sign in to comment.