Skip to content
This repository has been archived by the owner on Jun 5, 2023. It is now read-only.

Commit

Permalink
Fix receipts_v2 mismatch (#424)
Browse files Browse the repository at this point in the history
  • Loading branch information
madninja authored May 11, 2022
1 parent 9520321 commit e7a2546
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/bh_route_txns.erl
Original file line number Diff line number Diff line change
Expand Up @@ -761,7 +761,7 @@ txn_to_json({Height, Time, Hash, Type, Fields}) when is_map(Fields) ->
txn_to_json({poc_request_v1, #{<<"location">> := Location} = Fields}) ->
?INSERT_LAT_LON(Location, Fields);
txn_to_json(
{Type, #{<<"challenger_location">> := ChallengerLoc, <<"path">> := Path} = Fields}
{Type, #{<<"path">> := Path} = Fields}
) when Type == poc_receipts_v1 orelse Type == poc_receipts_v2 ->
%% update witnesses to include location_hex at res8
WitnessLocationHex = fun(PathElem) ->
Expand Down Expand Up @@ -810,6 +810,7 @@ txn_to_json(
end,
lists:zip(lists:seq(1, length(Path)), Path)
),
ChallengerLoc = maps:get(<<"challenger_location">>, Fields, undefined),
?INSERT_LAT_LON(ChallengerLoc, {<<"challenger_lat">>, <<"challenger_lon">>}, Fields#{
<<"path">> => NewPath
});
Expand Down

0 comments on commit e7a2546

Please sign in to comment.