mirror of
https://github.com/bigchaindb/bigchaindb.git
synced 2024-10-13 13:34:05 +00:00
Problem: Tendermint change to store validator changes at height h+2 will break Election.get_status
Solution: Reworked `get_validator_change` to look at only the latest block height or less
This commit is contained in:
parent
cc0ce0e5e4
commit
f2f045c730
@ -35,7 +35,7 @@ class Election(Transaction):
|
|||||||
ELECTION_THRESHOLD = 2 / 3
|
ELECTION_THRESHOLD = 2 / 3
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
def get_validator_change(cls, bigchain, height=None):
|
def get_validator_change(cls, bigchain):
|
||||||
"""Return the latest change to the validator set
|
"""Return the latest change to the validator set
|
||||||
|
|
||||||
:return: {
|
:return: {
|
||||||
@ -44,6 +44,7 @@ class Election(Transaction):
|
|||||||
'election_id': <election_id_that_approved_the_change>
|
'election_id': <election_id_that_approved_the_change>
|
||||||
}
|
}
|
||||||
"""
|
"""
|
||||||
|
height = bigchain.get_latest_block()['height']
|
||||||
return bigchain.get_validator_change(height)
|
return bigchain.get_validator_change(height)
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user