updates for python3
This commit is contained in:
@@ -517,7 +517,7 @@ class Network(util.DaemonThread):
|
||||
if self.server_is_lagging() and self.auto_connect:
|
||||
# switch to one that has the correct header (not height)
|
||||
header = self.blockchain().read_header(self.get_local_height())
|
||||
filtered = map(lambda x:x[0], filter(lambda x: x[1].tip_header==header, self.interfaces.items()))
|
||||
filtered = list(map(lambda x:x[0], filter(lambda x: x[1].tip_header==header, self.interfaces.items())))
|
||||
if filtered:
|
||||
choice = random.choice(filtered)
|
||||
self.switch_to_interface(choice)
|
||||
@@ -1047,7 +1047,7 @@ class Network(util.DaemonThread):
|
||||
def get_blockchains(self):
|
||||
out = {}
|
||||
for k, b in self.blockchains.items():
|
||||
r = filter(lambda i: i.blockchain==b, self.interfaces.values())
|
||||
r = list(filter(lambda i: i.blockchain==b, self.interfaces.values()))
|
||||
if r:
|
||||
out[k] = r
|
||||
return out
|
||||
|
||||
Reference in New Issue
Block a user