Skip to content

Commit

Permalink
Merge pull request #30 from helium/adt/one-more-acs-completion-check
Browse files Browse the repository at this point in the history
More consensus fixes to ACS
  • Loading branch information
Vagabond committed Nov 19, 2018
2 parents 568891a + 658ce08 commit d7ebbc1
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions src/hbbft_acs.erl
Original file line number Diff line number Diff line change
Expand Up @@ -110,10 +110,9 @@ handle_msg(Data, J, {{rbc, I}, RBCMsg}) ->
case hbbft_bba:input(BBA#bba_state.bba_data, 1) of
{DoneBBA, ok} ->
%% this BBA probably already completed, check if ACS has completed
check_completion(store_bba_state(NewData, I, DoneBBA), []);
check_completion(store_bba_input(store_bba_state(NewData, I, DoneBBA), I, 1), []);
{NewBBA, {send, ToSend}} ->
{store_bba_input(store_bba_state(NewData, I, NewBBA), I, 1),
{send, hbbft_utils:wrap({bba, I}, ToSend)}}
check_completion(store_bba_input(store_bba_state(NewData, I, NewBBA), I, 1), hbbft_utils:wrap({bba, I}, ToSend))
end
end;
{NewRBC, ok} ->
Expand Down Expand Up @@ -141,7 +140,7 @@ handle_msg(Data = #acs_data{n=N, f=F}, J, {{bba, I}, BBAMsg}) ->
{FailedBBA, {send, ToSend}} ->
{store_bba_input(store_bba_state(DataAcc, E, FailedBBA), E, 0), [hbbft_utils:wrap({bba, E}, ToSend)|MsgAcc]};
{DoneBBA, ok} ->
{store_bba_state(DataAcc, E, DoneBBA), MsgAcc}
{store_bba_input(store_bba_state(DataAcc, E, DoneBBA), E, 0), MsgAcc}
end;
true ->
Acc
Expand Down

0 comments on commit d7ebbc1

Please sign in to comment.