Fix message type

This commit is contained in:
Zoltán Papp 2024-09-10 16:34:11 +02:00
parent 1d233a5b5e
commit 56badd7535

View File

@ -199,7 +199,7 @@ func MarshalAuthMsg(peerID []byte, authPayload []byte) ([]byte, error) {
msg := make([]byte, SizeOfProtoHeader+sizeOfMagicByte, SizeOfProtoHeader+headerSizeAuth+len(authPayload))
msg[0] = byte(CurrentProtocolVersion)
msg[1] = byte(MsgTypeHello)
msg[1] = byte(MsgTypeAuth)
copy(msg[SizeOfProtoHeader:SizeOfProtoHeader+sizeOfMagicByte], magicHeader)
@ -230,7 +230,7 @@ func MarshalAuthResponse(address string) ([]byte, error) {
msg := make([]byte, SizeOfProtoHeader, SizeOfProtoHeader+headerSizeAuthResp+len(ab))
msg[0] = byte(CurrentProtocolVersion)
msg[1] = byte(MsgTypeHelloResponse)
msg[1] = byte(MsgTypeAuthResponse)
msg = append(msg, ab...)