mirror of
https://github.com/kvazar-network/kevacoin.git
synced 2025-01-17 18:40:09 +00:00
Adapt ZMQ/rest serialization to take rpcserialversion arg
This commit is contained in:
parent
bc7ff8db99
commit
412bab22b2
@ -228,7 +228,7 @@ static bool rest_block(HTTPRequest* req,
|
|||||||
return RESTERR(req, HTTP_NOT_FOUND, hashStr + " not found");
|
return RESTERR(req, HTTP_NOT_FOUND, hashStr + " not found");
|
||||||
}
|
}
|
||||||
|
|
||||||
CDataStream ssBlock(SER_NETWORK, PROTOCOL_VERSION);
|
CDataStream ssBlock(SER_NETWORK, PROTOCOL_VERSION | RPCSerializationFlags());
|
||||||
ssBlock << block;
|
ssBlock << block;
|
||||||
|
|
||||||
switch (rf) {
|
switch (rf) {
|
||||||
@ -368,7 +368,7 @@ static bool rest_tx(HTTPRequest* req, const std::string& strURIPart)
|
|||||||
if (!GetTransaction(hash, tx, Params().GetConsensus(), hashBlock, true))
|
if (!GetTransaction(hash, tx, Params().GetConsensus(), hashBlock, true))
|
||||||
return RESTERR(req, HTTP_NOT_FOUND, hashStr + " not found");
|
return RESTERR(req, HTTP_NOT_FOUND, hashStr + " not found");
|
||||||
|
|
||||||
CDataStream ssTx(SER_NETWORK, PROTOCOL_VERSION);
|
CDataStream ssTx(SER_NETWORK, PROTOCOL_VERSION | RPCSerializationFlags());
|
||||||
ssTx << tx;
|
ssTx << tx;
|
||||||
|
|
||||||
switch (rf) {
|
switch (rf) {
|
||||||
|
@ -7,6 +7,7 @@
|
|||||||
#include "zmqpublishnotifier.h"
|
#include "zmqpublishnotifier.h"
|
||||||
#include "validation.h"
|
#include "validation.h"
|
||||||
#include "util.h"
|
#include "util.h"
|
||||||
|
#include "rpc/server.h"
|
||||||
|
|
||||||
static std::multimap<std::string, CZMQAbstractPublishNotifier*> mapPublishNotifiers;
|
static std::multimap<std::string, CZMQAbstractPublishNotifier*> mapPublishNotifiers;
|
||||||
|
|
||||||
@ -166,7 +167,7 @@ bool CZMQPublishRawBlockNotifier::NotifyBlock(const CBlockIndex *pindex)
|
|||||||
LogPrint("zmq", "zmq: Publish rawblock %s\n", pindex->GetBlockHash().GetHex());
|
LogPrint("zmq", "zmq: Publish rawblock %s\n", pindex->GetBlockHash().GetHex());
|
||||||
|
|
||||||
const Consensus::Params& consensusParams = Params().GetConsensus();
|
const Consensus::Params& consensusParams = Params().GetConsensus();
|
||||||
CDataStream ss(SER_NETWORK, PROTOCOL_VERSION);
|
CDataStream ss(SER_NETWORK, PROTOCOL_VERSION | RPCSerializationFlags());
|
||||||
{
|
{
|
||||||
LOCK(cs_main);
|
LOCK(cs_main);
|
||||||
CBlock block;
|
CBlock block;
|
||||||
@ -186,7 +187,7 @@ bool CZMQPublishRawTransactionNotifier::NotifyTransaction(const CTransaction &tr
|
|||||||
{
|
{
|
||||||
uint256 hash = transaction.GetHash();
|
uint256 hash = transaction.GetHash();
|
||||||
LogPrint("zmq", "zmq: Publish rawtx %s\n", hash.GetHex());
|
LogPrint("zmq", "zmq: Publish rawtx %s\n", hash.GetHex());
|
||||||
CDataStream ss(SER_NETWORK, PROTOCOL_VERSION);
|
CDataStream ss(SER_NETWORK, PROTOCOL_VERSION | RPCSerializationFlags());
|
||||||
ss << transaction;
|
ss << transaction;
|
||||||
return SendMessage(MSG_RAWTX, &(*ss.begin()), ss.size());
|
return SendMessage(MSG_RAWTX, &(*ss.begin()), ss.size());
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user