aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMarcoFalke <falke.marco@gmail.com>2022-02-01 10:18:49 +0100
committerMarcoFalke <falke.marco@gmail.com>2022-02-01 10:18:53 +0100
commit36f8e99d24db968a96b5ef79faf6232c77735637 (patch)
treeb87d23c455d3cf4e6d4756482723695d97261e76 /src
parentfcac16fff87b9a949b925831167c2ca5e22eac2c (diff)
parentfa2406a50a83184d101d1bb3f2b282ae280370ba (diff)
downloadbitcoin-36f8e99d24db968a96b5ef79faf6232c77735637.tar.xz
Merge bitcoin/bitcoin#24218: zmq: Fix implicit-integer-sign-change
fa2406a50a83184d101d1bb3f2b282ae280370ba zmq: Fix implicit-integer-sign-change (MarcoFalke) Pull request description: uint256::begin() returns unsigned data, so there is no reason to make it signed. Fix that and remove the sanitizer suppression. ACKs for top commit: hebasto: ACK fa2406a50a83184d101d1bb3f2b282ae280370ba PastaPastaPasta: utACK fa2406a50a83184d101d1bb3f2b282ae280370ba, I have reviewed the code and think it makes sense Tree-SHA512: 150ebcf3fdc3e0f60b6fd8e5fe638737b01e8a0863296bd545fb5ed17d33ab23b2ff94204996aa7b4617650b7383bd86ed2d2bf46746b410feae449de179a2bd
Diffstat (limited to 'src')
-rw-r--r--src/zmq/zmqpublishnotifier.cpp10
1 files changed, 6 insertions, 4 deletions
diff --git a/src/zmq/zmqpublishnotifier.cpp b/src/zmq/zmqpublishnotifier.cpp
index 543db10612..2c6f24a239 100644
--- a/src/zmq/zmqpublishnotifier.cpp
+++ b/src/zmq/zmqpublishnotifier.cpp
@@ -209,9 +209,10 @@ bool CZMQPublishHashBlockNotifier::NotifyBlock(const CBlockIndex *pindex)
{
uint256 hash = pindex->GetBlockHash();
LogPrint(BCLog::ZMQ, "zmq: Publish hashblock %s to %s\n", hash.GetHex(), this->address);
- char data[32];
- for (unsigned int i = 0; i < 32; i++)
+ uint8_t data[32];
+ for (unsigned int i = 0; i < 32; i++) {
data[31 - i] = hash.begin()[i];
+ }
return SendZmqMessage(MSG_HASHBLOCK, data, 32);
}
@@ -219,9 +220,10 @@ bool CZMQPublishHashTransactionNotifier::NotifyTransaction(const CTransaction &t
{
uint256 hash = transaction.GetHash();
LogPrint(BCLog::ZMQ, "zmq: Publish hashtx %s to %s\n", hash.GetHex(), this->address);
- char data[32];
- for (unsigned int i = 0; i < 32; i++)
+ uint8_t data[32];
+ for (unsigned int i = 0; i < 32; i++) {
data[31 - i] = hash.begin()[i];
+ }
return SendZmqMessage(MSG_HASHTX, data, 32);
}