@@ -152,13 +152,13 @@ filter(AddrList, Ledger, Height, Vars) ->
152152 {ok , V } -> V ;
153153 _ -> false
154154 end ,
155- MaxActivityAge = max_activity_age (Vars ),
155+ MaxActivityAge = blockchain_utils : max_activity_age (Vars ),
156156 lists :filter (
157157 fun (A ) ->
158158 {ok , Gateway } = blockchain_ledger_v1 :find_gateway_info (A , Ledger ),
159159 Mode = blockchain_ledger_gateway_v2 :mode (Gateway ),
160160 LastActivity = blockchain_ledger_gateway_v2 :last_poc_challenge (Gateway ),
161- is_active (ActivityFilterEnabled , LastActivity , MaxActivityAge , Height ) andalso
161+ is_active (ActivityFilterEnabled , Height , LastActivity , MaxActivityAge ) andalso
162162 blockchain_ledger_gateway_v2 :is_valid_capability (
163163 Mode ,
164164 ? GW_CAPABILITY_POC_CHALLENGEE ,
@@ -204,19 +204,11 @@ limit_addrs(_Vars, RandState, Witnesses) ->
204204 {RandState , Witnesses }.
205205
206206-spec is_active (ActivityFilterEnabled :: boolean (),
207+ Height :: pos_integer (),
207208 LastActivity :: pos_integer (),
208- MaxActivityAge :: pos_integer (),
209- Height :: pos_integer ()) -> boolean ().
210- is_active (true , undefined , _MaxActivityAge , _Height ) ->
211- false ;
212- is_active (true , LastActivity , MaxActivityAge , Height ) ->
213- (Height - LastActivity ) < MaxActivityAge ;
214- is_active (_ActivityFilterEnabled , _Gateway , _Height , _Vars ) ->
215- true .
216-
217- -spec max_activity_age (Vars :: map ()) -> pos_integer ().
218- max_activity_age (Vars ) ->
219- case maps :get (harmonize_activity_on_hip17_interactivity_blocks , Vars , false ) of
220- true -> maps :get (hip17_interactivity_blocks , Vars );
221- false -> maps :get (poc_v4_target_challenge_age , Vars )
222- end .
209+ MaxActivityAge :: pos_integer ()
210+ ) -> boolean ().
211+ is_active (false , _Height , _LastActivity , _MaxActivityAge ) ->
212+ true ;
213+ is_active (true , Height , LastActivity , MaxActivityAge ) ->
214+ blockchain_utils :is_gw_active (Height , LastActivity , MaxActivityAge ).
0 commit comments