From 0044d6cf75e9f84b2d23f136158de5e845e57e40 Mon Sep 17 00:00:00 2001 From: Jack Date: Sat, 17 Dec 2016 20:05:27 -0500 Subject: [PATCH] BlobAvailabilityTracker.sample bug, remove whitespace --- lbrynet/core/BlobAvailability.py | 3 +-- lbrynet/core/Wallet.py | 2 -- 2 files changed, 1 insertion(+), 4 deletions(-) diff --git a/lbrynet/core/BlobAvailability.py b/lbrynet/core/BlobAvailability.py index 69f012a5b..a15b625db 100644 --- a/lbrynet/core/BlobAvailability.py +++ b/lbrynet/core/BlobAvailability.py @@ -80,7 +80,6 @@ class BlobAvailabilityTracker(object): d = self._get_most_popular() d.addCallback(lambda _: self._set_mean_peers()) - def _update_mine(self): def _get_peers(blobs): dl = [] @@ -89,7 +88,7 @@ class BlobAvailabilityTracker(object): return defer.DeferredList(dl) def sample(blobs): - return random.sample(blobs, 100) + return random.sample(blobs, min(len(blobs), 100)) start = time.time() log.debug('==> Updating the peers for my blobs') diff --git a/lbrynet/core/Wallet.py b/lbrynet/core/Wallet.py index 15d52da14..04665e8d7 100644 --- a/lbrynet/core/Wallet.py +++ b/lbrynet/core/Wallet.py @@ -919,7 +919,6 @@ class LBRYumWallet(Wallet): func = getattr(self.cmd_runner, cmd.name) return defer.succeed(func(*args)) - # run commands as a deferToThread, lbryum commands that only make # queries to lbryum server should be run this way def _run_cmd_as_defer_to_thread(self, command_name, *args): @@ -1055,7 +1054,6 @@ class LBRYumWallet(Wallet): return defer.succeed(val) - class LBRYcrdAddressRequester(object): implements([IRequestCreator])