In essence, what we should do would be to indicate in the handshake if a training is being executed. In this way, the node will seek to participate in the next round (remember that for an existing round it will already have defined a trainset so there is no problem).
The problem is that inconsistencies would occur if the candidates for a node (which will also be the nodes for which voting will be expected) are set and a new node is connected to the network at that small instant of time. Having different candidates, obtaining the most voted nodes will cause divergence in the trainset.
nc_votes = {
k: v for k, v in self.__train_set_votes.items() if k in candidates
}
It may not be too complicated to solve, but due to lack of time it has been impossible for me to spend time to fix this little bug and I have simply decided that the inconsistencies cannot be caused.
Best regards,
Pedro.