mirror of
https://github.com/tendermint/tendermint.git
synced 2026-09-24 17:04:20 +00:00
p2p: limit rate of dialing new peers (#6485)
This commit is contained in:
@@ -2,6 +2,7 @@ package http
|
||||
|
||||
import (
|
||||
"context"
|
||||
"errors"
|
||||
"fmt"
|
||||
"math/rand"
|
||||
"net/url"
|
||||
@@ -122,6 +123,12 @@ func (p *http) LightBlock(ctx context.Context, height int64) (*types.LightBlock,
|
||||
}
|
||||
}
|
||||
|
||||
if sh.Header == nil {
|
||||
return nil, provider.ErrBadLightBlock{
|
||||
Reason: errors.New("header is nil unexpectedly"),
|
||||
}
|
||||
}
|
||||
|
||||
vs, err := p.validatorSet(ctx, &sh.Height)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
|
||||
Reference in New Issue
Block a user