mirror of
https://github.com/bitcoin/bitcoin.git
synced 2026-01-20 15:19:07 +01:00
scripted-diff: get rid of remaining "command" terminology in protocol.{h,cpp}
-BEGIN VERIFY SCRIPT- sed -i s/COMMAND_SIZE/MESSAGE_TYPE_SIZE/g $(git grep -l COMMAND_SIZE) sed -i s/pszCommand/msg_type/g $(git grep -l pszCommand) sed -i s/pchCommand/m_msg_type/g $(git grep -l pchCommand) sed -i s/GetCommand/GetMessageType/g ./src/net.cpp ./src/protocol.cpp ./src/protocol.h ./src/test/fuzz/protocol.cpp sed -i s/IsCommandValid/IsMessageTypeValid/g $(git grep -l IsCommandValid) sed -i "s/command/message type/g" ./src/protocol.h ./src/protocol.cpp -END VERIFY SCRIPT-
This commit is contained in:
@@ -1024,7 +1024,7 @@ static RPCHelpMan sendmsgtopeer()
|
||||
"This RPC is for testing only.",
|
||||
{
|
||||
{"peer_id", RPCArg::Type::NUM, RPCArg::Optional::NO, "The peer to send the message to."},
|
||||
{"msg_type", RPCArg::Type::STR, RPCArg::Optional::NO, strprintf("The message type (maximum length %i)", CMessageHeader::COMMAND_SIZE)},
|
||||
{"msg_type", RPCArg::Type::STR, RPCArg::Optional::NO, strprintf("The message type (maximum length %i)", CMessageHeader::MESSAGE_TYPE_SIZE)},
|
||||
{"msg", RPCArg::Type::STR_HEX, RPCArg::Optional::NO, "The serialized message body to send, in hex, without a message header"},
|
||||
},
|
||||
RPCResult{RPCResult::Type::OBJ, "", "", std::vector<RPCResult>{}},
|
||||
@@ -1033,8 +1033,8 @@ static RPCHelpMan sendmsgtopeer()
|
||||
[&](const RPCHelpMan& self, const JSONRPCRequest& request) -> UniValue {
|
||||
const NodeId peer_id{request.params[0].getInt<int64_t>()};
|
||||
const std::string& msg_type{request.params[1].get_str()};
|
||||
if (msg_type.size() > CMessageHeader::COMMAND_SIZE) {
|
||||
throw JSONRPCError(RPC_INVALID_PARAMETER, strprintf("Error: msg_type too long, max length is %i", CMessageHeader::COMMAND_SIZE));
|
||||
if (msg_type.size() > CMessageHeader::MESSAGE_TYPE_SIZE) {
|
||||
throw JSONRPCError(RPC_INVALID_PARAMETER, strprintf("Error: msg_type too long, max length is %i", CMessageHeader::MESSAGE_TYPE_SIZE));
|
||||
}
|
||||
auto msg{TryParseHex<unsigned char>(request.params[2].get_str())};
|
||||
if (!msg.has_value()) {
|
||||
|
||||
Reference in New Issue
Block a user