We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 91d21cf commit df1d5afCopy full SHA for df1d5af
go/consensus/cometbft/light/client.go
@@ -122,6 +122,18 @@ func (c *Client) LastTrustedHeight() (int64, error) {
122
return height, nil
123
}
124
125
+// FirstTrustedHeight returns the first (oldest) trusted height.
126
+func (c *Client) FirstTrustedHeight() (int64, error) {
127
+ height, err := c.lightClient.FirstTrustedHeight()
128
+ if err != nil {
129
+ return 0, err
130
+ }
131
+ if height == -1 {
132
+ return 0, fmt.Errorf("no trusted headers")
133
134
+ return height, nil
135
+}
136
+
137
// VerifyHeader verifies the given header.
138
func (c *Client) VerifyHeader(ctx context.Context, header *cmttypes.Header) error {
139
c.mu.Lock()
0 commit comments