Browse Source

Merge pull request #7504 from bitromortac/2109-sample-from-list

Python3.9 compat: sample from list
patch-4
ghost43 3 years ago
committed by GitHub
parent
commit
a555eb3106
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 2
      electrum/channel_db.py

2
electrum/channel_db.py

@ -354,7 +354,7 @@ class ChannelDB(SqlDB):
def get_200_randomly_sorted_nodes_not_in(self, node_ids):
with self.lock:
unshuffled = set(self._nodes.keys()) - node_ids
return random.sample(unshuffled, min(200, len(unshuffled)))
return random.sample(list(unshuffled), min(200, len(unshuffled)))
def get_last_good_address(self, node_id: bytes) -> Optional[LNPeerAddr]:
"""Returns latest address we successfully connected to, for given node."""

Loading…
Cancel
Save