Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

improvement(header|p2p)!: remove limit status code #1530

Merged
merged 1 commit into from
Dec 22, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions header/p2p/helpers.go
Original file line number Diff line number Diff line change
Expand Up @@ -89,8 +89,6 @@ func convertStatusCodeToError(code p2p_pb.StatusCode) error {
return nil
case p2p_pb.StatusCode_NOT_FOUND:
return header.ErrNotFound
case p2p_pb.StatusCode_LIMIT_EXCEEDED:
return header.ErrHeadersLimitExceeded
default:
return fmt.Errorf("unknown status code %d", code)
}
Expand Down
54 changes: 25 additions & 29 deletions header/p2p/pb/extended_header_request.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion header/p2p/pb/extended_header_request.proto
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ enum StatusCode {
INVALID = 0;
OK = 1;
NOT_FOUND = 2;
LIMIT_EXCEEDED = 3;
};

message ExtendedHeaderResponse {
Expand Down
2 changes: 0 additions & 2 deletions header/p2p/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -107,8 +107,6 @@ func (serv *ExchangeServer) requestHandler(stream network.Stream) {
code = p2p_pb.StatusCode_OK
case header.ErrNotFound:
code = p2p_pb.StatusCode_NOT_FOUND
case header.ErrHeadersLimitExceeded:
code = p2p_pb.StatusCode_LIMIT_EXCEEDED
default:
stream.Reset() //nolint:errcheck
return
Expand Down