mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-08-19 10:22:23 +00:00
If only the last signer is left, voting for it is invalid
This commit is contained in:
parent
f6ed68e13e
commit
c15e5b0c73
1 changed files with 5 additions and 0 deletions
|
|
@ -139,6 +139,11 @@ func (s *Snapshot) copy() *Snapshot {
|
||||||
// given snapshot context (e.g. don't try to add an already authorized signer).
|
// given snapshot context (e.g. don't try to add an already authorized signer).
|
||||||
func (s *Snapshot) validVote(address common.Address, authorize bool) bool {
|
func (s *Snapshot) validVote(address common.Address, authorize bool) bool {
|
||||||
_, signer := s.Signers[address]
|
_, signer := s.Signers[address]
|
||||||
|
|
||||||
|
if len(s.Signers) == 1 && signer && authorize == false {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
|
||||||
return (signer && !authorize) || (!signer && authorize)
|
return (signer && !authorize) || (!signer && authorize)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue