Skip to content

Commit 5a80ad1

Browse files
committed
Rename VoteCollector::vote to collect
1 parent 7d6cb20 commit 5a80ad1

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

core/src/consensus/tendermint/vote_collector.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ impl Default for VoteCollector {
120120

121121
impl VoteCollector {
122122
/// Insert vote if it is newer than the oldest one.
123-
pub fn vote(&mut self, message: ConsensusMessage) -> Option<DoubleVote> {
123+
pub fn collect(&mut self, message: ConsensusMessage) -> Option<DoubleVote> {
124124
self.votes.entry(*message.round()).or_insert_with(Default::default).insert(message)
125125
}
126126

core/src/consensus/tendermint/worker.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -927,7 +927,7 @@ impl Worker {
927927
on: on.clone(),
928928
};
929929
if !self.votes.is_old_or_known(&message) {
930-
self.votes.vote(message);
930+
self.votes.collect(message);
931931
}
932932
}
933933

@@ -1394,7 +1394,7 @@ impl Worker {
13941394
self.votes_received.set(vote_index);
13951395
}
13961396

1397-
if let Some(double) = self.votes.vote(message.clone()) {
1397+
if let Some(double) = self.votes.collect(message.clone()) {
13981398
cerror!(ENGINE, "Double vote found {:?}", double);
13991399
self.report_double_vote(&double);
14001400
return Err(EngineError::DoubleVote(sender))
@@ -1512,7 +1512,7 @@ impl Worker {
15121512
};
15131513

15141514
self.votes_received.set(vote.signer_index);
1515-
self.votes.vote(vote.clone());
1515+
self.votes.collect(vote.clone());
15161516
cinfo!(ENGINE, "Voted {:?} as {}th validator.", vote, signer_index);
15171517
Ok(Some(vote))
15181518
}
@@ -1538,7 +1538,7 @@ impl Worker {
15381538
on,
15391539
};
15401540

1541-
self.votes.vote(vote.clone());
1541+
self.votes.collect(vote.clone());
15421542
cinfo!(ENGINE, "Voted {:?} as {}th proposer.", vote, signer_index);
15431543
Ok(vote)
15441544
}
@@ -1790,7 +1790,7 @@ impl Worker {
17901790
);
17911791
}
17921792

1793-
if let Some(double) = self.votes.vote(message.clone()) {
1793+
if let Some(double) = self.votes.collect(message.clone()) {
17941794
cerror!(ENGINE, "Double Vote found {:?}", double);
17951795
self.report_double_vote(&double);
17961796
return None
@@ -2125,7 +2125,7 @@ impl Worker {
21252125
cdebug!(ENGINE, "Commit message-{} is verified", commit_height);
21262126
for vote in votes {
21272127
if !self.votes.is_old_or_known(&vote) {
2128-
self.votes.vote(vote);
2128+
self.votes.collect(vote);
21292129
}
21302130
}
21312131

0 commit comments

Comments
 (0)