Add send_voted
This commit is contained in:
parent
8b1aaa5d36
commit
3cb93361f2
@ -182,7 +182,16 @@ namespace paxos
|
||||
vote.decree = decree;
|
||||
ledger.set_prev_vote(vote);
|
||||
|
||||
sender = sender;
|
||||
send_voted(ballot, sender);
|
||||
}
|
||||
|
||||
void Legislator::send_voted(int ballot, std::string receiver)
|
||||
{
|
||||
Message message;
|
||||
message.set_method("Voted");
|
||||
message.add_header("ballot", std::to_string(ballot));
|
||||
message.add_header("sender", self->config_.name);
|
||||
SendEW::send_message(message, legislators[receiver]);
|
||||
}
|
||||
|
||||
void Legislator::handle_message(Message message)
|
||||
|
@ -29,6 +29,8 @@ namespace paxos
|
||||
void receive_begin_ballot(Message message);
|
||||
void receive_begin_ballot(int ballot, int decree, std::string sender);
|
||||
|
||||
void send_voted(int ballot, std::string receiver);
|
||||
|
||||
void handle_message(Message message);
|
||||
|
||||
Ledger ledger;
|
||||
|
Loading…
Reference in New Issue
Block a user