mirror of
https://github.com/bigchaindb/bigchaindb.git
synced 2024-10-13 13:34:05 +00:00
Problem: run_upsert_validator_approve casts votes for *all* voters, not just the user calling the command
Solution: Filter vote txs by the users public key
This commit is contained in:
parent
7b1c55fc50
commit
8c0bf8caa0
@ -161,7 +161,8 @@ def run_upsert_validator_approve(args, bigchain):
|
||||
tx = bigchain.get_transaction(args.election_id)
|
||||
voting_power = [v.amount for v in tx.outputs if key.public_key in v.public_keys][0]
|
||||
|
||||
approval = ValidatorElectionVote.generate(tx.to_inputs(), [
|
||||
inputs = [input for input in tx.to_inputs() if key.public_key in input.owners_before]
|
||||
approval = ValidatorElectionVote.generate(inputs, [
|
||||
([key.public_key], voting_power)], tx.id).sign([key.private_key])
|
||||
approval.validate(bigchain)
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user