Send votes to next leader's TPU instead of our TPU (#16663)

(cherry picked from commit c8b474cd0b)

Co-authored-by: Michael Vines <mvines@gmail.com>
This commit is contained in:
mergify[bot]
2021-04-20 08:45:58 +00:00
committed by GitHub
parent 3865219085
commit 5057aaddc0
3 changed files with 43 additions and 12 deletions

View File

@@ -1183,8 +1183,8 @@ impl ClusterInfo {
.process_push_message(&self_pubkey, vec![vote], now);
}
pub fn send_vote(&self, vote: &Transaction) -> Result<()> {
let tpu = self.my_contact_info().tpu;
pub fn send_vote(&self, vote: &Transaction, tpu: Option<SocketAddr>) -> Result<()> {
let tpu = tpu.unwrap_or_else(|| self.my_contact_info().tpu);
let buf = serialize(vote)?;
self.socket.send_to(&buf, &tpu)?;
Ok(())