| 17847 | return " | ".join(labels) |
| 17848 | |
| 17849 | def _crypto_peer_stats(self, counterparties): |
| 17850 | if not counterparties: |
| 17851 | return None, 0 |
| 17852 | sorted_peers = sorted(counterparties.items(), key=lambda x: x[1], reverse=True) |
| 17853 | top = sorted_peers[0][1] if sorted_peers else 0 |
| 17854 | total = sum(counterparties.values()) or 0 |
| 17855 | concentration = (top / total) if total else 0 |
| 17856 | return concentration, len(sorted_peers) |
| 17857 | |
| 17858 | def _crypto_top_counterparties(self, peer_map, top_n=5): |
| 17859 | if not peer_map: |