-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(p2p): Extend Head request with RequestOptions and introduce With…
…SubjectiveInit opt
- Loading branch information
Showing
4 changed files
with
106 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
package p2p | ||
|
||
type RequestOption func(opts *RequestParams) | ||
|
||
// RequestParams contains options to be used for header Exchange | ||
// requests. | ||
type RequestParams struct { | ||
// SubjectiveInit determines whether the Exchange should use | ||
// trusted peers for its Head request (true = yes). | ||
SubjectiveInit bool | ||
} | ||
|
||
func DefaultRequestParams() RequestParams { | ||
return RequestParams{ | ||
SubjectiveInit: false, | ||
} | ||
} | ||
|
||
// WithSubjectiveInit TODO | ||
func WithSubjectiveInit(opts *RequestParams) { | ||
opts.SubjectiveInit = true | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters