mirror of https://github.com/status-im/go-waku.git
fix: use same privKey when displaying addresses
This commit is contained in:
parent
1c991a94d8
commit
a956684f48
|
@ -88,7 +88,7 @@ func New(ctx context.Context, opts ...WakuNodeOption) (*WakuNode, error) {
|
|||
}
|
||||
|
||||
if params.privKey != nil {
|
||||
params.libP2POpts = append(params.libP2POpts, libp2p.Identity(*params.privKey))
|
||||
params.libP2POpts = append(params.libP2POpts, params.Identity())
|
||||
}
|
||||
|
||||
if params.addressFactory != nil {
|
||||
|
|
|
@ -10,6 +10,7 @@ import (
|
|||
connmgr "github.com/libp2p/go-libp2p-connmgr"
|
||||
"github.com/libp2p/go-libp2p-core/crypto"
|
||||
pubsub "github.com/libp2p/go-libp2p-pubsub"
|
||||
"github.com/libp2p/go-libp2p/config"
|
||||
basichost "github.com/libp2p/go-libp2p/p2p/host/basic"
|
||||
"github.com/multiformats/go-multiaddr"
|
||||
ma "github.com/multiformats/go-multiaddr"
|
||||
|
@ -54,6 +55,10 @@ func (w WakuNodeParameters) MultiAddresses() []ma.Multiaddr {
|
|||
return w.multiAddr
|
||||
}
|
||||
|
||||
func (w WakuNodeParameters) Identity() config.Option {
|
||||
return libp2p.Identity(*w.privKey)
|
||||
}
|
||||
|
||||
// WithHostAddress is a WakuNodeOption that configures libp2p to listen on a list of net endpoint addresses
|
||||
func WithHostAddress(hostAddr []net.Addr) WakuNodeOption {
|
||||
return func(params *WakuNodeParameters) error {
|
||||
|
|
Loading…
Reference in New Issue