From 0a204176827fd69152c2480d89319b39f1a5a501 Mon Sep 17 00:00:00 2001 From: Scott Lystig Fritchie Date: Sun, 13 Sep 2015 14:56:28 +0900 Subject: [PATCH] Adjustments for CP mode (still slightly experimental) --- src/machi_chain_manager1.erl | 9 ++------- src/machi_fitness.erl | 6 +++++- 2 files changed, 7 insertions(+), 8 deletions(-) diff --git a/src/machi_chain_manager1.erl b/src/machi_chain_manager1.erl index d3f39af..db5f13a 100644 --- a/src/machi_chain_manager1.erl +++ b/src/machi_chain_manager1.erl @@ -1516,12 +1516,8 @@ react_to_env_B10(Retries, P_newprop, P_latest, LatestUnanimousP, repairing=P_latest_repairing} = P_latest, I_am_in_P_latest_upi = lists:member(MyName, P_latest_upi), I_am_in_P_latest_repairing = lists:member(MyName, P_latest_repairing), - IsRelevantToMe_p = if CMode == cp_mode -> + IsRelevantToMe_p = if P_latest_author == MyName -> true; - CMode == ap_mode, - P_latest_author == MyName -> - true; - CMode == ap_mode, not (I_am_in_P_latest_upi orelse I_am_in_P_latest_repairing) -> %% There is no sense for me to leave whatever @@ -1532,7 +1528,6 @@ react_to_env_B10(Retries, P_newprop, P_latest, LatestUnanimousP, %% now P_latest and it's unanimous. But that %% doesn't make it a good idea. ^_^ false; - CMode == ap_mode, I_am_in_P_latest_repairing -> %% If I'm already in the current UPI, and the %% UPI is longer than 1 (i.e., more than just @@ -1543,7 +1538,7 @@ react_to_env_B10(Retries, P_newprop, P_latest, LatestUnanimousP, %% join a repairing list is relevant. not (lists:member(MyName, P_current_upi) andalso length(P_current_upi) > 1); - CMode == ap_mode -> + true -> true end, ?REACT({b10,?LINE,[{newprop_epoch,P_newprop#projection_v1.epoch_number}, diff --git a/src/machi_fitness.erl b/src/machi_fitness.erl index 74c3ffa..854a463 100644 --- a/src/machi_fitness.erl +++ b/src/machi_fitness.erl @@ -312,7 +312,11 @@ do_incoming_spam(Author, Map, NewMap = map_merge(OldMap, Map), %% NewMapV = map_value(NewMap), %% io:format(user, "YY3 ~p\n", [NewMapV]), - S2 = do_map_change(NewMap, [MyFluName, Author], MembersDict, S), + + %% Hrm, we may have changes that are interesting to the + %% Author of this update, so perhaps we shouldn't exclude + %% Author from our update, right? + S2 = do_map_change(NewMap, [MyFluName], MembersDict, S), {ok, S2} end.