Skip to content

Commit a680ed8

Browse files
authoredMar 12, 2021
Replace TrustedLightBlock with VerifyLightBlockAtHeight in order to fetch header if it doesn't exist (cosmos#453)
1 parent f4e722e commit a680ed8

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed
 

‎relayer/tm-light-client.go

+3-1
Original file line numberDiff line numberDiff line change
@@ -294,7 +294,9 @@ func (c *Chain) GetLightSignedHeaderAtHeight(height int64) (*tmclient.Header, er
294294
return nil, err
295295
}
296296

297-
sh, err := client.TrustedLightBlock(height)
297+
// VerifyLightBlock will return the header at provided height if it already exists in store,
298+
// otherwise it retrieves from primary and verifies against trusted store before returning.
299+
sh, err := client.VerifyLightBlockAtHeight(context.Background(), height, time.Now())
298300
if err != nil {
299301
return nil, err
300302
}

0 commit comments

Comments
 (0)
Please sign in to comment.