don't prepend network to bitmask for list

This commit is contained in:
Cassandra Heart 2025-02-13 12:24:51 -06:00
parent 6f02e7b54f
commit b53d27d48e
No known key found for this signature in database
GPG Key ID: 6352152859385958

View File

@ -729,10 +729,7 @@ func (b *BlossomSub) GetPeerID() []byte {
}
func (b *BlossomSub) GetRandomPeer(bitmask []byte) ([]byte, error) {
// TODO: Fix this, it is broken - the bitmask parameter is not sliced, and the
// network is not pre-pended to the bitmask.
networkBitmask := append([]byte{b.p2pConfig.Network}, bitmask...)
peers := b.ps.ListPeers(networkBitmask)
peers := b.ps.ListPeers(bitmask)
if len(peers) == 0 {
return nil, errors.Wrap(
ErrNoPeersAvailable,