use of com.jd.blockchain.consensus.raft.client.RaftConsensusClient in project jdchain-core by blockchain-jd-com.
the class GatewayConsensusClientManager method isCredentialUpated.
private boolean isCredentialUpated(ConsensusClient client, SessionCredential sessionCredential) {
if (client instanceof BftsmartConsensusClient && sessionCredential instanceof BftsmartSessionCredential) {
BftsmartConsensusClient bftsmartClient = (BftsmartConsensusClient) client;
BftsmartSessionCredential newCredential = (BftsmartSessionCredential) sessionCredential;
BftsmartSessionCredential oldCredential = bftsmartClient.getSettings().getSessionCredential();
// clientId 和 clientIdRange 任何一个有差异,都表示凭证已更新;
return oldCredential.getClientId() != newCredential.getClientId() || oldCredential.getClientIdRange() != newCredential.getClientIdRange();
} else if (client instanceof RaftConsensusClient) {
// return !((RaftConsensusClient)client).isInit();
return !((RaftConsensusClient) client).isConnected();
}
return true;
}
Aggregations