Skip to content

Commit

Permalink
beacon/light/api: fixed state proof request
Browse files Browse the repository at this point in the history
  • Loading branch information
zsfelfoldi committed Mar 15, 2023
1 parent c8486ac commit d308c70
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions beacon/light/api/light_api.go
Original file line number Diff line number Diff line change
Expand Up @@ -239,7 +239,7 @@ func (api *BeaconLightApi) SubscribeStateProof(format merkle.ProofFormat, paths
encFormat, bitLength := EncodeCompactProofFormat(format)
if api.stateProofVersion >= 2 {
_, err := api.httpGetf("/eth/v0/beacon/proof/subscribe/states?format=0x%x&first=%d&period=%d", encFormat, first, period)
if err != nil {
if err != nil && err != ErrNotFound {
return nil, err
}
}
Expand Down Expand Up @@ -393,8 +393,9 @@ func encodeProofFormatSubtree(format merkle.ProofFormat, target *[]byte, bitLeng
if bytePtr == len(*target) {
*target = append(*target, byte(0))
}
if left, right := format.Children(); left != nil {
if left, right := format.Children(); left == nil {
(*target)[bytePtr] += bitMask
} else {
encodeProofFormatSubtree(left, target, bitLength)
encodeProofFormatSubtree(right, target, bitLength)
}
Expand Down

0 comments on commit d308c70

Please sign in to comment.