add a method for requiring extensions

This commit is contained in:
William Banfield
2022-05-13 17:06:52 -04:00
parent b77af9b438
commit 504bffce4d
+9
View File
@@ -102,6 +102,15 @@ type VoteParams struct {
ExtensionRequireHeight int64 `json:"extension_require_height"`
}
// RequireExtensions returns true if vote extensions are required at height h
// and false otherwise.
func (v VoteParams) RequireExtensions(h int64) bool {
if v.ExtensionRequireHeight == 0 {
return false
}
return h <= v.ExtensionRequireHeight
}
// DefaultConsensusParams returns a default ConsensusParams.
func DefaultConsensusParams() *ConsensusParams {
return &ConsensusParams{