GetEmailMap returns a completely decoupled, point-in-time map of publicKey -> email. Replaces the over-engineered emailByKeySnapshotCache.
()
| 141 | // GetEmailMap returns a completely decoupled, point-in-time map of publicKey -> email. |
| 142 | // Replaces the over-engineered emailByKeySnapshotCache. |
| 143 | func (ps *PeerStore) GetEmailMap() map[string]string { |
| 144 | ps.mu.RLock() |
| 145 | defer ps.mu.RUnlock() |
| 146 | |
| 147 | snapshot := make(map[string]string, len(ps.peers)) |
| 148 | for key, peer := range ps.peers { |
| 149 | snapshot[key] = peer.Email |
| 150 | } |
| 151 | return snapshot |
| 152 | } |
no outgoing calls