parent
56d0ad869a
commit
9b5bcb81fd
@ -151,12 +151,12 @@ impl Tendermint {
|
|||||||
fn generate_message(&self, block_hash: Option<BlockHash>) -> Option<Bytes> {
|
fn generate_message(&self, block_hash: Option<BlockHash>) -> Option<Bytes> {
|
||||||
let h = self.height.load(AtomicOrdering::SeqCst);
|
let h = self.height.load(AtomicOrdering::SeqCst);
|
||||||
let r = self.view.load(AtomicOrdering::SeqCst);
|
let r = self.view.load(AtomicOrdering::SeqCst);
|
||||||
let s = self.step.read();
|
let s = *self.step.read();
|
||||||
let vote_info = message_info_rlp(&VoteStep::new(h, r, *s), block_hash);
|
let vote_info = message_info_rlp(&VoteStep::new(h, r, s), block_hash);
|
||||||
match self.signer.sign(vote_info.sha3()).map(Into::into) {
|
match self.signer.sign(vote_info.sha3()).map(Into::into) {
|
||||||
Ok(signature) => {
|
Ok(signature) => {
|
||||||
let message_rlp = message_full_rlp(&signature, &vote_info);
|
let message_rlp = message_full_rlp(&signature, &vote_info);
|
||||||
let message = ConsensusMessage::new(signature, h, r, *s, block_hash);
|
let message = ConsensusMessage::new(signature, h, r, s, block_hash);
|
||||||
let validator = self.signer.address();
|
let validator = self.signer.address();
|
||||||
self.votes.vote(message.clone(), &validator);
|
self.votes.vote(message.clone(), &validator);
|
||||||
debug!(target: "engine", "Generated {:?} as {}.", message, validator);
|
debug!(target: "engine", "Generated {:?} as {}.", message, validator);
|
||||||
|
Loading…
Reference in New Issue
Block a user