Skip to content
This repository has been archived by the owner on Nov 6, 2020. It is now read-only.

Commit

Permalink
Fix Tendermint deadlock (#4654)
Browse files Browse the repository at this point in the history
* scope read

* consistent step
  • Loading branch information
keorn authored and gavofyork committed Feb 24, 2017
1 parent 56d0ad8 commit 9b5bcb8
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions ethcore/src/engines/tendermint/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -151,12 +151,12 @@ impl Tendermint {
fn generate_message(&self, block_hash: Option<BlockHash>) -> Option<Bytes> {
let h = self.height.load(AtomicOrdering::SeqCst);
let r = self.view.load(AtomicOrdering::SeqCst);
let s = self.step.read();
let vote_info = message_info_rlp(&VoteStep::new(h, r, *s), block_hash);
let s = *self.step.read();
let vote_info = message_info_rlp(&VoteStep::new(h, r, s), block_hash);
match self.signer.sign(vote_info.sha3()).map(Into::into) {
Ok(signature) => {
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();
self.votes.vote(message.clone(), &validator);
debug!(target: "engine", "Generated {:?} as {}.", message, validator);
Expand Down

0 comments on commit 9b5bcb8

Please sign in to comment.