diff options
author | Anthony Towns <aj@erisian.com.au> | 2023-09-07 19:16:57 +1000 |
---|---|---|
committer | Anthony Towns <aj@erisian.com.au> | 2023-11-14 08:45:30 +1000 |
commit | 6e9e4e6130797b721c8df1eabaf46ec25ebb6abe (patch) | |
tree | 6444c337cd23d1e6aabedf229a9efb1583fb7351 /src/rest.cpp | |
parent | 5800c558eb5efb4839ed00d6967e43306d68e1c3 (diff) |
Use ParamsWrapper for witness serialization
Diffstat (limited to 'src/rest.cpp')
-rw-r--r-- | src/rest.cpp | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/src/rest.cpp b/src/rest.cpp index 71b7036980..f86c47ee6b 100644 --- a/src/rest.cpp +++ b/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"); |