mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-11-11 14:38:29 +01:00
refactor: Replace HexStr(o.begin(), o.end()) with HexStr(o)
HexStr can be called with anything that bas `begin()` and `end()` functions, so clean up the redundant calls.
This commit is contained in:
@@ -188,7 +188,7 @@ static bool rest_headers(const util::Ref& context,
|
||||
ssHeader << pindex->GetBlockHeader();
|
||||
}
|
||||
|
||||
std::string strHex = HexStr(ssHeader.begin(), ssHeader.end()) + "\n";
|
||||
std::string strHex = HexStr(ssHeader) + "\n";
|
||||
req->WriteHeader("Content-Type", "text/plain");
|
||||
req->WriteReply(HTTP_OK, strHex);
|
||||
return true;
|
||||
@@ -253,7 +253,7 @@ static bool rest_block(HTTPRequest* req,
|
||||
case RetFormat::HEX: {
|
||||
CDataStream ssBlock(SER_NETWORK, PROTOCOL_VERSION | RPCSerializationFlags());
|
||||
ssBlock << block;
|
||||
std::string strHex = HexStr(ssBlock.begin(), ssBlock.end()) + "\n";
|
||||
std::string strHex = HexStr(ssBlock) + "\n";
|
||||
req->WriteHeader("Content-Type", "text/plain");
|
||||
req->WriteReply(HTTP_OK, strHex);
|
||||
return true;
|
||||
@@ -391,7 +391,7 @@ static bool rest_tx(const util::Ref& context, HTTPRequest* req, const std::strin
|
||||
CDataStream ssTx(SER_NETWORK, PROTOCOL_VERSION | RPCSerializationFlags());
|
||||
ssTx << tx;
|
||||
|
||||
std::string strHex = HexStr(ssTx.begin(), ssTx.end()) + "\n";
|
||||
std::string strHex = HexStr(ssTx) + "\n";
|
||||
req->WriteHeader("Content-Type", "text/plain");
|
||||
req->WriteReply(HTTP_OK, strHex);
|
||||
return true;
|
||||
@@ -556,7 +556,7 @@ static bool rest_getutxos(const util::Ref& context, HTTPRequest* req, const std:
|
||||
case RetFormat::HEX: {
|
||||
CDataStream ssGetUTXOResponse(SER_NETWORK, PROTOCOL_VERSION);
|
||||
ssGetUTXOResponse << ::ChainActive().Height() << ::ChainActive().Tip()->GetBlockHash() << bitmap << outs;
|
||||
std::string strHex = HexStr(ssGetUTXOResponse.begin(), ssGetUTXOResponse.end()) + "\n";
|
||||
std::string strHex = HexStr(ssGetUTXOResponse) + "\n";
|
||||
|
||||
req->WriteHeader("Content-Type", "text/plain");
|
||||
req->WriteReply(HTTP_OK, strHex);
|
||||
|
||||
Reference in New Issue
Block a user