Skip to content

Commit

Permalink
remove bound on number of SignedPeerRecords
Browse files Browse the repository at this point in the history
  • Loading branch information
sukunrt committed Sep 16, 2024
1 parent 0a6a579 commit d0aad5c
Showing 1 changed file with 0 additions and 7 deletions.
7 changes: 0 additions & 7 deletions p2p/host/peerstore/pstoremem/addr_book.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,6 @@ import (
ma "github.com/multiformats/go-multiaddr"
)

var SignedPeerRecordBound = 100_000

var log = logging.Logger("peerstore")

type expiringAddr struct {
Expand Down Expand Up @@ -231,8 +229,6 @@ func (mab *memoryAddrBook) AddAddrs(p peer.ID, addrs []ma.Multiaddr, ttl time.Du
mab.addAddrs(p, addrs, ttl)
}

var ErrTooManyRecords = fmt.Errorf("too many signed peer records. Dropping this one")

// ConsumePeerRecord adds addresses from a signed peer.PeerRecord, which will expire after the given TTL.
// See https://godoc.org/github.com/libp2p/go-libp2p/core/peerstore#CertifiedAddrBook for more details.
func (mab *memoryAddrBook) ConsumePeerRecord(recordEnvelope *record.Envelope, ttl time.Duration) (bool, error) {
Expand All @@ -250,9 +246,6 @@ func (mab *memoryAddrBook) ConsumePeerRecord(recordEnvelope *record.Envelope, tt

mab.mu.Lock()
defer mab.mu.Unlock()
if (len(mab.signedPeerRecords)) >= SignedPeerRecordBound {
return false, ErrTooManyRecords
}

// ensure seq is greater than or equal to the last received
lastState, found := mab.signedPeerRecords[rec.PeerID]
Expand Down

0 comments on commit d0aad5c

Please sign in to comment.