From ad2157b5f5ced482202c16a737c636c4067128b0 Mon Sep 17 00:00:00 2001 From: huochexizhan Date: Sat, 1 Mar 2025 01:25:21 +0800 Subject: [PATCH] fix: fix incorrect nil return value Signed-off-by: huochexizhan --- p2p/net/conngater/conngater.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/p2p/net/conngater/conngater.go b/p2p/net/conngater/conngater.go index bcc927f184..8c9084c5a0 100644 --- a/p2p/net/conngater/conngater.go +++ b/p2p/net/conngater/conngater.go @@ -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)