mirror of
https://github.com/bigchaindb/bigchaindb.git
synced 2024-10-13 13:34:05 +00:00
Problem: get_validator doesn't sepcify height leading to ambiguity
Solution: get_validator should specify the height of the latest block witnessed by BigchainDB so that in case tendermint is ahead of BigchainDB correct validator set can be fetched
This commit is contained in:
parent
49bc495cc4
commit
25da49582b
@ -462,7 +462,10 @@ class BigchainDB(object):
|
||||
|
||||
def get_validators(self):
|
||||
try:
|
||||
resp = requests.get('{}validators'.format(self.endpoint))
|
||||
block = self.get_latest_block()
|
||||
query_args = ('?height=' + str(block['height'])) if block else ''
|
||||
|
||||
resp = requests.get('{}validators{}'.format(self.endpoint, query_args))
|
||||
validators = resp.json()['result']['validators']
|
||||
for v in validators:
|
||||
v.pop('accum')
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user