Skip to content

Commit

Permalink
Add use_condenser to witnesses and update changelog
Browse files Browse the repository at this point in the history
  • Loading branch information
holgern committed Sep 7, 2020
1 parent 7ee4bc5 commit 4cf18f5
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ Changelog
* Add set_expiration to Object Cache
* Use floor instead of round in beembase/Amount in order to handle floats which have a higher precision than allowed
* json_str parameter has been added to beembase.Amount, when True, a json dict is returned as string (needing when broadcasting with use_condenser=False)
* Handle deleted comments in beempy pending thanks to @crokkon

0.24.8
------
Expand Down
9 changes: 6 additions & 3 deletions beem/witness.py
Original file line number Diff line number Diff line change
Expand Up @@ -360,7 +360,10 @@ def refresh(self):
if self.blockchain.rpc.get_use_appbase():
self.active_witnessess = self.blockchain.rpc.get_active_witnesses(api="database")['witnesses']
self.schedule = self.blockchain.rpc.get_witness_schedule(api="database")
self.witness_count = self.blockchain.rpc.get_witness_count(api="condenser")
if self.blockchain.config["use_condenser"]:
self.witness_count = self.blockchain.rpc.get_witness_count(api="condenser")
else:
self.witness_count = self.blockchain.rpc.get_witness_count()
else:
self.active_witnessess = self.blockchain.rpc.get_active_witnesses()
self.schedule = self.blockchain.rpc.get_witness_schedule()
Expand Down Expand Up @@ -446,7 +449,7 @@ def __init__(self, from_account="", limit=100, lazy=False, full=False, blockchai
witnessList = []
last_limit = limit
self.identifier = ""
use_condenser = True
use_condenser = self.blockchain.config["use_condenser"]
self.blockchain.rpc.set_next_node_on_empty_reply(False)
if self.blockchain.rpc.get_use_appbase() and not use_condenser:
query_limit = 1000
Expand Down Expand Up @@ -474,7 +477,7 @@ def __init__(self, from_account="", limit=100, lazy=False, full=False, blockchai
if (last_limit < limit):
last_limit += 1
if self.blockchain.rpc.get_use_appbase() and not use_condenser:
witnessess = self.blockchain.rpc.list_witnesses({'start': [last_account], 'limit': last_limit, 'order': 'by_vote_name'}, api="database")['witnesses']
witnessess = self.blockchain.rpc.list_witnesses({'start': [0, last_account], 'limit': last_limit, 'order': 'by_vote_name'}, api="database")['witnesses']
elif self.blockchain.rpc.get_use_appbase() and use_condenser:
witnessess = self.blockchain.rpc.get_witnesses_by_vote(last_account, last_limit, api="condenser")
else:
Expand Down

0 comments on commit 4cf18f5

Please sign in to comment.