Skip to content

Commit 8554dcc

Browse files
committed
Rename VoteCollector::vote to collect
1 parent d06080c commit 8554dcc

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
@@ -921,7 +921,7 @@ impl Worker {
921921
on: on.clone(),
922922
};
923923
if !self.votes.is_old_or_known(&message) {
924-
self.votes.vote(message);
924+
self.votes.collect(message);
925925
}
926926
}
927927

@@ -1387,7 +1387,7 @@ impl Worker {
13871387
self.votes_received.set(vote_index);
13881388
}
13891389

1390-
if let Some(double) = self.votes.vote(message.clone()) {
1390+
if let Some(double) = self.votes.collect(message.clone()) {
13911391
cerror!(ENGINE, "Double vote found {:?}", double);
13921392
self.report_double_vote(&double);
13931393
return Err(EngineError::DoubleVote(sender))
@@ -1505,7 +1505,7 @@ impl Worker {
15051505
};
15061506

15071507
self.votes_received.set(vote.signer_index);
1508-
self.votes.vote(vote.clone());
1508+
self.votes.collect(vote.clone());
15091509
cinfo!(ENGINE, "Voted {:?} as {}th validator.", vote, signer_index);
15101510
Ok(Some(vote))
15111511
}
@@ -1531,7 +1531,7 @@ impl Worker {
15311531
on,
15321532
};
15331533

1534-
self.votes.vote(vote.clone());
1534+
self.votes.collect(vote.clone());
15351535
cinfo!(ENGINE, "Voted {:?} as {}th proposer.", vote, signer_index);
15361536
Ok(vote)
15371537
}
@@ -1783,7 +1783,7 @@ impl Worker {
17831783
);
17841784
}
17851785

1786-
if let Some(double) = self.votes.vote(message.clone()) {
1786+
if let Some(double) = self.votes.collect(message.clone()) {
17871787
cerror!(ENGINE, "Double Vote found {:?}", double);
17881788
self.report_double_vote(&double);
17891789
return None
@@ -2117,7 +2117,7 @@ impl Worker {
21172117
cdebug!(ENGINE, "Commit message-{} is verified", commit_height);
21182118
for vote in votes {
21192119
if !self.votes.is_old_or_known(&vote) {
2120-
self.votes.vote(vote);
2120+
self.votes.collect(vote);
21212121
}
21222122
}
21232123

0 commit comments

Comments
 (0)