Skip to content

Commit

Permalink
updates
Browse files Browse the repository at this point in the history
  • Loading branch information
shiqizng committed Jul 21, 2023
1 parent 24e65f2 commit a4ba318
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions network/p2p/peerstore/peerstore.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,6 @@ func initDBStore(path string) (ds.Batching, error) {
}

// NewPeerStore creates a new peerstore backed by a datastore.
// TODO: consider using PebbleDB in the future.
// it is currently still in experimental state. https://github.com/ipfs/go-ds-pebble
func NewPeerStore(ctx context.Context, path string, addrInfo []*peer.AddrInfo) (*PeerStore, error) {
datastore, err := initDBStore(path)
if err != nil {
Expand All @@ -53,7 +51,7 @@ func NewPeerStore(ctx context.Context, path string, addrInfo []*peer.AddrInfo) (
// initialize peerstore with addresses
for i := 0; i < len(addrInfo); i++ {
info := addrInfo[i]
ps.AddAddrs(info.ID, info.Addrs, libp2p.PermanentAddrTTL)
ps.AddAddrs(info.ID, info.Addrs, libp2p.AddressTTL)
}
pstore := &PeerStore{ps}
return pstore, nil
Expand Down

0 comments on commit a4ba318

Please sign in to comment.