mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-11-10 14:08:40 +01:00
Use ParamsWrapper for witness serialization
This commit is contained in:
16
src/rest.cpp
16
src/rest.cpp
@@ -317,8 +317,8 @@ static bool rest_block(const std::any& context,
|
||||
|
||||
switch (rf) {
|
||||
case RESTResponseFormat::BINARY: {
|
||||
CDataStream ssBlock(SER_NETWORK, PROTOCOL_VERSION | RPCSerializationFlags());
|
||||
ssBlock << block;
|
||||
DataStream ssBlock;
|
||||
ssBlock << RPCTxSerParams(block);
|
||||
std::string binaryBlock = ssBlock.str();
|
||||
req->WriteHeader("Content-Type", "application/octet-stream");
|
||||
req->WriteReply(HTTP_OK, binaryBlock);
|
||||
@@ -326,8 +326,8 @@ static bool rest_block(const std::any& context,
|
||||
}
|
||||
|
||||
case RESTResponseFormat::HEX: {
|
||||
CDataStream ssBlock(SER_NETWORK, PROTOCOL_VERSION | RPCSerializationFlags());
|
||||
ssBlock << block;
|
||||
DataStream ssBlock;
|
||||
ssBlock << RPCTxSerParams(block);
|
||||
std::string strHex = HexStr(ssBlock) + "\n";
|
||||
req->WriteHeader("Content-Type", "text/plain");
|
||||
req->WriteReply(HTTP_OK, strHex);
|
||||
@@ -723,8 +723,8 @@ static bool rest_tx(const std::any& context, HTTPRequest* req, const std::string
|
||||
|
||||
switch (rf) {
|
||||
case RESTResponseFormat::BINARY: {
|
||||
CDataStream ssTx(SER_NETWORK, PROTOCOL_VERSION | RPCSerializationFlags());
|
||||
ssTx << tx;
|
||||
DataStream ssTx;
|
||||
ssTx << RPCTxSerParams(tx);
|
||||
|
||||
std::string binaryTx = ssTx.str();
|
||||
req->WriteHeader("Content-Type", "application/octet-stream");
|
||||
@@ -733,8 +733,8 @@ static bool rest_tx(const std::any& context, HTTPRequest* req, const std::string
|
||||
}
|
||||
|
||||
case RESTResponseFormat::HEX: {
|
||||
CDataStream ssTx(SER_NETWORK, PROTOCOL_VERSION | RPCSerializationFlags());
|
||||
ssTx << tx;
|
||||
DataStream ssTx;
|
||||
ssTx << RPCTxSerParams(tx);
|
||||
|
||||
std::string strHex = HexStr(ssTx) + "\n";
|
||||
req->WriteHeader("Content-Type", "text/plain");
|
||||
|
||||
Reference in New Issue
Block a user