void RespondToRegisterPow1withError(IPEndPoint requesterEndpoint, RegisterPow1ResponseStatusCode statusCode, uint pow1RequestId) { var response = new RegisterPow1ResponsePacket { StatusCode = statusCode, Pow1RequestId = pow1RequestId }; SendPacket(response.Encode(), requesterEndpoint); }
public RegisterPow1ResponsePacket(byte[] rpPow1ResponsePacketData) { var reader = PacketProcedures.CreateBinaryReader(rpPow1ResponsePacketData, 1); Pow1RequestId = reader.ReadUInt32(); Flags = reader.ReadByte(); if ((Flags & FlagsMask_MustBeZero) != 0) { throw new NotImplementedException(); } StatusCode = (RegisterPow1ResponseStatusCode)reader.ReadByte(); if (StatusCode == RegisterPow1ResponseStatusCode.succeeded_Pow2Challenge) { ProofOfWork2Request = reader.ReadBytes(16); } }
public Pow1RejectedException(RegisterPow1ResponseStatusCode responseCode) : base($"EP rejected PoW1 request with status = {responseCode}") { }