Commit 833b1cbb authored by harrylee's avatar harrylee

fix a bug for localPeer logger nil pointer dereference

parent c056eb0f
...@@ -17,6 +17,7 @@ const ( ...@@ -17,6 +17,7 @@ const (
Router = "router" Router = "router"
Swarm = "swarm" Swarm = "swarm"
Syncer = "syncer" Syncer = "syncer"
Local = "local"
) )
var w *loggerWrapper var w *loggerWrapper
......
...@@ -2,6 +2,7 @@ package peermgr ...@@ -2,6 +2,7 @@ package peermgr
import ( import (
"errors" "errors"
"gitlab.33.cn/link33/sidecar/internal/loggers"
"github.com/libp2p/go-libp2p-core/peer" "github.com/libp2p/go-libp2p-core/peer"
"github.com/meshplus/bitxhub-kit/crypto" "github.com/meshplus/bitxhub-kit/crypto"
...@@ -30,6 +31,7 @@ func newLocal(id peer.ID, privKey crypto.PrivateKey) *localPeer { ...@@ -30,6 +31,7 @@ func newLocal(id peer.ID, privKey crypto.PrivateKey) *localPeer {
tag: Office, tag: Office,
rev: make(chan *pb.Message, port.MaxCapacity), rev: make(chan *pb.Message, port.MaxCapacity),
privKey: privKey, privKey: privKey,
logger: loggers.Logger(loggers.Local),
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment