@@ -511,7 +511,6 @@ export default class Blockchain implements BlockchainInterface {
511
511
// Do two rounds here, one to execute on a potential previously reached consensus
512
512
// on the newly touched beneficiary, one with the added new vote
513
513
for ( let round = 1 ; round <= 2 ; round ++ ) {
514
-
515
514
// See if there is a new majority consensus to update the signer list
516
515
const lastEpochBlockNumber = header . number . sub (
517
516
header . number . mod ( new BN ( this . _common . consensusConfig ( ) . epoch ) )
@@ -521,7 +520,7 @@ export default class Blockchain implements BlockchainInterface {
521
520
let consensus = false
522
521
523
522
// AUTH vote analysis
524
- if ( round === 1 || round === 2 && nonce . equals ( CLIQUE_NONCE_AUTH ) ) {
523
+ if ( round === 1 || ( round === 2 && nonce . equals ( CLIQUE_NONCE_AUTH ) ) ) {
525
524
let beneficiaryVotesAUTH = this . _cliqueLatestVotes . filter ( ( vote ) => {
526
525
return (
527
526
vote [ 0 ] . gte ( lastEpochBlockNumber ) &&
@@ -552,7 +551,7 @@ export default class Blockchain implements BlockchainInterface {
552
551
}
553
552
}
554
553
// DROP vote
555
- if ( round === 1 || round === 2 && nonce . equals ( CLIQUE_NONCE_DROP ) ) {
554
+ if ( round === 1 || ( round === 2 && nonce . equals ( CLIQUE_NONCE_DROP ) ) ) {
556
555
let beneficiaryVotesDROP = this . _cliqueLatestVotes . filter ( ( vote ) => {
557
556
return (
558
557
vote [ 0 ] . gte ( lastEpochBlockNumber ) &&
@@ -569,9 +568,9 @@ export default class Blockchain implements BlockchainInterface {
569
568
consensus = true
570
569
// Drop signer
571
570
activeSigners = activeSigners . filter ( ( signer ) => ! signer . equals ( beneficiary ) )
572
- // Discard votes from removed signer
573
571
this . _cliqueLatestVotes = this . _cliqueLatestVotes . filter (
574
- ( vote ) => ! vote [ 1 ] [ 0 ] . equals ( beneficiary )
572
+ // Discard votes from removed signer and for removed signer
573
+ ( vote ) => ! vote [ 1 ] [ 0 ] . equals ( beneficiary ) && ! vote [ 1 ] [ 1 ] . equals ( beneficiary )
575
574
)
576
575
debug (
577
576
`[Block ${ header . number . toNumber ( ) } ] Clique majority consensus (DROP ${ beneficiary } )`
0 commit comments