mirror of
https://github.com/ElementsProject/elements.git
synced 2026-08-18 13:17:55 +02:00
Use ParamsWrapper for witness serialization
This commit is contained in:
parent
5800c558eb
commit
6e9e4e6130
59 changed files with 226 additions and 219 deletions
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");
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue