'Throw a critical error if there is a duplicate vote'

@classmethod
def dedupe_by_voter(cls, eligible_votes):

    by_voter = {}
    for vote in eligible_votes:
        pubkey = vote['node_pubkey']
        if (pubkey in by_voter):
            raise CriticalDuplicateVote(pubkey)
        by_voter[pubkey] = vote
    return by_voter
