mirror of
https://github.com/libp2p/go-libp2p.git
synced 2025-09-26 20:21:26 +08:00
conngater: fix incorrect err return value (#3219)
This commit is contained in:
@@ -72,7 +72,7 @@ func (cg *BasicConnectionGater) loadRules(ctx context.Context) error {
|
||||
for r := range res.Next() {
|
||||
if r.Error != nil {
|
||||
log.Errorf("query result error: %s", r.Error)
|
||||
return err
|
||||
return r.Error
|
||||
}
|
||||
|
||||
p := peer.ID(r.Entry.Value)
|
||||
@@ -89,7 +89,7 @@ func (cg *BasicConnectionGater) loadRules(ctx context.Context) error {
|
||||
for r := range res.Next() {
|
||||
if r.Error != nil {
|
||||
log.Errorf("query result error: %s", r.Error)
|
||||
return err
|
||||
return r.Error
|
||||
}
|
||||
|
||||
ip := net.IP(r.Entry.Value)
|
||||
@@ -106,7 +106,7 @@ func (cg *BasicConnectionGater) loadRules(ctx context.Context) error {
|
||||
for r := range res.Next() {
|
||||
if r.Error != nil {
|
||||
log.Errorf("query result error: %s", r.Error)
|
||||
return err
|
||||
return r.Error
|
||||
}
|
||||
|
||||
ipnetStr := string(r.Entry.Value)
|
||||
|
Reference in New Issue
Block a user