Skip to content

Commit 412bab2

Browse files
committed
Adapt ZMQ/rest serialization to take rpcserialversion arg
1 parent bc7ff8d commit 412bab2

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

src/rest.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -228,7 +228,7 @@ static bool rest_block(HTTPRequest* req,
228228
return RESTERR(req, HTTP_NOT_FOUND, hashStr + " not found");
229229
}
230230

231-
CDataStream ssBlock(SER_NETWORK, PROTOCOL_VERSION);
231+
CDataStream ssBlock(SER_NETWORK, PROTOCOL_VERSION | RPCSerializationFlags());
232232
ssBlock << block;
233233

234234
switch (rf) {
@@ -368,7 +368,7 @@ static bool rest_tx(HTTPRequest* req, const std::string& strURIPart)
368368
if (!GetTransaction(hash, tx, Params().GetConsensus(), hashBlock, true))
369369
return RESTERR(req, HTTP_NOT_FOUND, hashStr + " not found");
370370

371-
CDataStream ssTx(SER_NETWORK, PROTOCOL_VERSION);
371+
CDataStream ssTx(SER_NETWORK, PROTOCOL_VERSION | RPCSerializationFlags());
372372
ssTx << tx;
373373

374374
switch (rf) {

src/zmq/zmqpublishnotifier.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
#include "zmqpublishnotifier.h"
88
#include "validation.h"
99
#include "util.h"
10+
#include "rpc/server.h"
1011

1112
static std::multimap<std::string, CZMQAbstractPublishNotifier*> mapPublishNotifiers;
1213

@@ -166,7 +167,7 @@ bool CZMQPublishRawBlockNotifier::NotifyBlock(const CBlockIndex *pindex)
166167
LogPrint("zmq", "zmq: Publish rawblock %s\n", pindex->GetBlockHash().GetHex());
167168

168169
const Consensus::Params& consensusParams = Params().GetConsensus();
169-
CDataStream ss(SER_NETWORK, PROTOCOL_VERSION);
170+
CDataStream ss(SER_NETWORK, PROTOCOL_VERSION | RPCSerializationFlags());
170171
{
171172
LOCK(cs_main);
172173
CBlock block;
@@ -186,7 +187,7 @@ bool CZMQPublishRawTransactionNotifier::NotifyTransaction(const CTransaction &tr
186187
{
187188
uint256 hash = transaction.GetHash();
188189
LogPrint("zmq", "zmq: Publish rawtx %s\n", hash.GetHex());
189-
CDataStream ss(SER_NETWORK, PROTOCOL_VERSION);
190+
CDataStream ss(SER_NETWORK, PROTOCOL_VERSION | RPCSerializationFlags());
190191
ss << transaction;
191192
return SendMessage(MSG_RAWTX, &(*ss.begin()), ss.size());
192193
}

0 commit comments

Comments
 (0)