func (ids *IDs) GetForPeer(peerID types.NodeID) uint16 {
	ids.mtx.RLock()
	defer ids.mtx.RUnlock()
	return ids.peerMap[peerID]
}
GetForPeer returns an ID reserved for the peer.
package mempool
import (
	"fmt"
	tmsync "github.com/tendermint/tendermint/internal/libs/sync"
	"github.com/tendermint/tendermint/types"
)
type IDs struct {
	mtx       tmsync.RWMutex
	peerMap   map[types.NodeID]uint16
	nextID    uint16               
	activeIDs map[uint16]struct{}  
}
func NewMempoolIDs() *IDs {
	return &IDs{
		peerMap: make(map[types.NodeID]uint16),
		activeIDs: map[uint16]struct{}{UnknownPeerID: {}},
		nextID:    1,
	}
}
func (ids *IDs) ReserveForPeer(peerID types.NodeID) {
	ids.mtx.Lock()
	defer ids.mtx.Unlock()
	curID := ids.nextPeerID()
	ids.peerMap[peerID] = curID
	ids.activeIDs[curID] = struct{}{}
}
func (ids *IDs) Reclaim(peerID types.NodeID) {
	ids.mtx.Lock()
	defer ids.mtx.Unlock()
	removedID, ok := ids.peerMap[peerID]
	if ok {
		delete(ids.activeIDs, removedID)
		delete(ids.peerMap, peerID)
	}
}