Skip to content
Snippets Groups Projects
Commit 3c78ac8d authored by Holger's avatar Holger
Browse files

Replace recursive call by while loop

* Update nodes in Nodelist
* Disable seed.bitcoiner.me node
parent d1b15a92
No related branches found
No related tags found
No related merge requests found
...@@ -637,23 +637,34 @@ class Account(BlockchainObject): ...@@ -637,23 +637,34 @@ class Account(BlockchainObject):
""" """
if not self.steem.is_connected(): if not self.steem.is_connected():
raise OfflineHasNoRPCException("No RPC available in offline mode!") raise OfflineHasNoRPCException("No RPC available in offline mode!")
self.steem.rpc.set_next_node_on_empty_reply(False) followers_list = []
if self.steem.rpc.get_use_appbase(): limit_reached = True
query = {'account': self.name, 'start': last_user, 'type': what, 'limit': limit} cnt = 0
if direction == "follower": while limit_reached:
followers = self.steem.rpc.get_followers(query, api='follow')['followers'] self.steem.rpc.set_next_node_on_empty_reply(False)
elif direction == "following": if self.steem.rpc.get_use_appbase():
followers = self.steem.rpc.get_following(query, api='follow')['following'] query = {'account': self.name, 'start': last_user, 'type': what, 'limit': limit}
else: if direction == "follower":
if direction == "follower": followers = self.steem.rpc.get_followers(query, api='follow')['followers']
followers = self.steem.rpc.get_followers(self.name, last_user, what, limit, api='follow') elif direction == "following":
elif direction == "following": followers = self.steem.rpc.get_following(query, api='follow')['following']
followers = self.steem.rpc.get_following(self.name, last_user, what, limit, api='follow') else:
if direction == "follower":
if len(followers) >= limit: followers = self.steem.rpc.get_followers(self.name, last_user, what, limit, api='follow')
followers += self._get_followers( elif direction == "following":
direction=direction, last_user=followers[-1][direction])[1:] followers = self.steem.rpc.get_following(self.name, last_user, what, limit, api='follow')
return followers if cnt == 0:
followers_list = followers
elif len(followers) > 1:
followers_list += followers[1:]
if len(followers) >= limit:
last_user = followers[-1][direction]
limit_reached = True
cnt += 1
else:
limit_reached = False
return followers_list
@property @property
def available_balances(self): def available_balances(self):
......
...@@ -28,42 +28,42 @@ class NodeList(list): ...@@ -28,42 +28,42 @@ class NodeList(list):
nodes = [ nodes = [
{ {
"url": "https://api.steemit.com", "url": "https://api.steemit.com",
"version": "0.19.4", "version": "0.19.10",
"type": "appbase", "type": "appbase",
"owner": "steemit", "owner": "steemit",
"score": 100 "score": 100
}, },
{ {
"url": "wss://appbasetest.timcliff.com", "url": "wss://appbasetest.timcliff.com",
"version": "0.19.4", "version": "0.19.10",
"type": "appbase", "type": "appbase",
"owner": "timcliff", "owner": "timcliff",
"score": 20 "score": 20
}, },
{ {
"url": "https://appbasetest.timcliff.com", "url": "https://appbasetest.timcliff.com",
"version": "0.19.4", "version": "0.19.10",
"type": "appbase", "type": "appbase",
"owner": "timcliff", "owner": "timcliff",
"score": 10 "score": 10
}, },
{ {
"url": "https://api.steem.house", "url": "https://api.steem.house",
"version": "0.19.4", "version": "0.19.10",
"type": "appbase", "type": "appbase",
"owner": "gtg", "owner": "gtg",
"score": 90 "score": 90
}, },
{ {
"url": "https://api.steemitdev.com", "url": "https://api.steemitdev.com",
"version": "0.19.4", "version": "0.19.10",
"type": "appbase-dev", "type": "appbase-dev",
"owner": "steemit", "owner": "steemit",
"score": 100 "score": 100
}, },
{ {
"url": "https://api.steemitstage.com", "url": "https://api.steemitstage.com",
"version": "0.19.4", "version": "0.19.10",
"type": "appbase-dev", "type": "appbase-dev",
"owner": "steemit", "owner": "steemit",
"score": 110 "score": 110
...@@ -73,98 +73,98 @@ class NodeList(list): ...@@ -73,98 +73,98 @@ class NodeList(list):
"version": "0.19.3", "version": "0.19.3",
"type": "normal", "type": "normal",
"owner": "ausbitbank", "owner": "ausbitbank",
"score": 125 "score": 1
}, },
{ {
"url": "https://rpc.steemviz.com", "url": "https://rpc.steemviz.com",
"version": "0.19.3", "version": "0.19.3",
"type": "normal", "type": "normal",
"owner": "ausbitbank", "owner": "ausbitbank",
"score": 80 "score": 1
}, },
{ {
"url": "wss://steemd.privex.io", "url": "wss://steemd.privex.io",
"version": "0.19.3", "version": "0.19.5",
"type": "normal", "type": "normal",
"owner": "privex", "owner": "privex",
"score": 150 "score": 150
}, },
{ {
"url": "https://steemd.privex.io", "url": "https://steemd.privex.io",
"version": "0.19.3", "version": "0.19.5",
"type": "normal", "type": "normal",
"owner": "privex", "owner": "privex",
"score": 50 "score": 50
}, },
{ {
"url": "wss://rpc.buildteam.io", "url": "wss://rpc.buildteam.io",
"version": "0.19.3", "version": "0.19.5",
"type": "normal", "type": "normal",
"owner": "themarkymark", "owner": "themarkymark",
"score": 165 "score": 165
}, },
{ {
"url": "https://rpc.buildteam.io", "url": "https://rpc.buildteam.io",
"version": "0.19.3", "version": "0.19.5",
"type": "normal", "type": "normal",
"owner": "themarkymark", "owner": "themarkymark",
"score": 120 "score": 120
}, },
{ {
"url": "wss://gtg.steem.house:8090", "url": "wss://gtg.steem.house:8090",
"version": "0.19.3", "version": "0.19.5",
"type": "normal", "type": "normal",
"owner": "gtg", "owner": "gtg",
"score": 75 "score": 75
}, },
{ {
"url": "https://gtg.steem.house:8090", "url": "https://gtg.steem.house:8090",
"version": "0.19.3", "version": "0.19.5",
"type": "normal", "type": "normal",
"owner": "gtg", "owner": "gtg",
"score": 80 "score": 80
}, },
{ {
"url": "wss://steemd.pevo.science", "url": "wss://steemd.pevo.science",
"version": "0.19.3", "version": "0.19.2",
"type": "normal", "type": "normal",
"owner": "pharesim", "owner": "pharesim",
"score": 170 "score": 10
}, },
{ {
"url": "https://steemd.pevo.science", "url": "https://steemd.pevo.science",
"version": "0.19.3", "version": "0.19.3",
"type": "normal", "type": "normal",
"owner": "pharesim", "owner": "pharesim",
"score": 30 "score": 10
}, },
{ {
"url": "wss://rpc.steemliberator.com", "url": "wss://rpc.steemliberator.com",
"version": "0.19.3", "version": "0.19.5",
"type": "normal", "type": "normal",
"owner": "netuoso", "owner": "netuoso",
"score": 20 "score": 50
}, },
{ {
"url": "https://rpc.steemliberator.com", "url": "https://rpc.steemliberator.com",
"version": "0.19.3", "version": "0.19.5",
"type": "normal", "type": "normal",
"owner": "netuoso", "owner": "netuoso",
"score": 10 "score": 20
}, },
{ {
"url": "wss://seed.bitcoiner.me", "url": "wss://seed.bitcoiner.me",
"version": "0.19.3", "version": "0.19.3",
"type": "normal", "type": "normal",
"owner": "bitcoiner", "owner": "bitcoiner",
"score": 1 "score": -10
}, },
{ {
"url": "https://seed.bitcoiner.me", "url": "https://seed.bitcoiner.me",
"version": "0.19.3", "version": "0.19.3",
"type": "normal", "type": "normal",
"owner": "bitcoiner", "owner": "bitcoiner",
"score": 1 "score": -10
}, },
{ {
"url": "wss://steemd.steemgigs.org", "url": "wss://steemd.steemgigs.org",
...@@ -185,18 +185,18 @@ class NodeList(list): ...@@ -185,18 +185,18 @@ class NodeList(list):
"version": "0.19.3", "version": "0.19.3",
"type": "normal", "type": "normal",
"owner": "followbtcnews", "owner": "followbtcnews",
"score": 120 "score": 10
}, },
{ {
"url": "https://steemd.minnowsupportproject.org", "url": "https://steemd.minnowsupportproject.org",
"version": "0.19.3", "version": "0.19.3",
"type": "normal", "type": "normal",
"owner": "followbtcnews", "owner": "followbtcnews",
"score": 90 "score": 10
}, },
{ {
"url": "https://rpc.curiesteem.com", "url": "https://rpc.curiesteem.com",
"version": "0.19.3", "version": "0.19.5",
"type": "normal", "type": "normal",
"owner": "curie", "owner": "curie",
"score": 50 "score": 50
...@@ -308,9 +308,9 @@ class NodeList(list): ...@@ -308,9 +308,9 @@ class NodeList(list):
def get_nodes(self, normal=True, appbase=True, dev=False, testnet=False, wss=True, https=True): def get_nodes(self, normal=True, appbase=True, dev=False, testnet=False, wss=True, https=True):
""" Returns nodes as list """ Returns nodes as list
:param bool normal: when True, nodes with version 0.19.2 or 0.19.3 are included :param bool normal: when True, nodes with version 0.19.5 are included
:param bool appbase: when True, nodes with version 0.19.4 are included :param bool appbase: when True, nodes with version 0.19.10 are included
:param bool dev: when True, dev nodes with version 0.19.4 are included :param bool dev: when True, dev nodes with version 0.19.10 are included
:param bool testnet: when True, testnet nodes are included :param bool testnet: when True, testnet nodes are included
""" """
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment