Skip to content

Commit b663d7b

Browse files
authored
conngater: fix incorrect err return value (#3219)
1 parent 5e6f217 commit b663d7b

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

p2p/net/conngater/conngater.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ func (cg *BasicConnectionGater) loadRules(ctx context.Context) error {
7272
for r := range res.Next() {
7373
if r.Error != nil {
7474
log.Errorf("query result error: %s", r.Error)
75-
return err
75+
return r.Error
7676
}
7777

7878
p := peer.ID(r.Entry.Value)
@@ -89,7 +89,7 @@ func (cg *BasicConnectionGater) loadRules(ctx context.Context) error {
8989
for r := range res.Next() {
9090
if r.Error != nil {
9191
log.Errorf("query result error: %s", r.Error)
92-
return err
92+
return r.Error
9393
}
9494

9595
ip := net.IP(r.Entry.Value)
@@ -106,7 +106,7 @@ func (cg *BasicConnectionGater) loadRules(ctx context.Context) error {
106106
for r := range res.Next() {
107107
if r.Error != nil {
108108
log.Errorf("query result error: %s", r.Error)
109-
return err
109+
return r.Error
110110
}
111111

112112
ipnetStr := string(r.Entry.Value)

0 commit comments

Comments
 (0)