diff --git a/beem/comment.py b/beem/comment.py index e57614314c16e5d751298edb56f039aac879af44..faf4f09d95a21403ad790f326278d7a2591fcd90 100644 --- a/beem/comment.py +++ b/beem/comment.py @@ -72,7 +72,7 @@ class Comment(BlockchainObject): self[p] = Amount(self.get(p, "0.000 SBD"), steem_instance=self.steem) # turn json_metadata into python dict - self.__metadata_to_dict() + self._metadata_to_dict() self["tags"] = [] self['community'] = '' if isinstance(self['json_metadata'], dict): @@ -84,13 +84,13 @@ class Comment(BlockchainObject): def _metadata_to_dict(self): """turn json_metadata into python dict""" meta_str = self.get("json_metadata", "{}") + if meta_str == "{}": + self['json_metadata'] = meta_str if isinstance(meta_str, (string_types, bytes_types, bytearray)): try: self['json_metadata'] = json.loads(meta_str) except: self['json_metadata'] = {} - else: - self['json_metadata'] = {} def refresh(self): if self.identifier == "": diff --git a/beem/vote.py b/beem/vote.py index 72e88d123b6520456ecce96915d534973e9857ac..3d30ff2e34522abee90dba50e4187e3504f988b1 100644 --- a/beem/vote.py +++ b/beem/vote.py @@ -100,7 +100,7 @@ class Vote(BlockchainObject): if x["voter"] == voter: vote = x if not vote: - raise VoteDoesNotExistsException + raise VoteDoesNotExistsException(self.identifier) super(Vote, self).__init__(vote, id_item="authorpermvoter", steem_instance=self.steem) self.identifier = construct_authorpermvoter(author, permlink, voter) diff --git a/beemapi/steemnoderpc.py b/beemapi/steemnoderpc.py index 5be3cee59099d5fbd016f0e181351e9aea284b47..6b5198b14d23986443843ae6bb46efd9a1698a91 100644 --- a/beemapi/steemnoderpc.py +++ b/beemapi/steemnoderpc.py @@ -56,9 +56,11 @@ class SteemNodeRPC(GrapheneRPC): # Forward call to GrapheneWebsocketRPC and catch+evaluate errors self.error_cnt_call = cnt reply = super(SteemNodeRPC, self).rpcexec(payload) - if self.next_node_on_empty_reply and not bool(reply): + if self.next_node_on_empty_reply and not bool(reply) and self.n_urls > 1: sleep_and_check_retries(self.num_retries_call, cnt, self.url, str("Empty reply"), sleep=False) self.next() + cnt = 0 + self.error_cnt_call = 0 doRetry = True else: self.next_node_on_empty_reply = False