Skip to content
Snippets Groups Projects
Commit 1aca7a8d authored by Jonah Husson's avatar Jonah Husson
Browse files

country should be in raw_points log

parent e578d340
No related branches found
No related tags found
1 merge request!10Points should maintain an external list of wallet to country mappings
......@@ -129,8 +129,6 @@ def process_period(conn, substrate, keypair, point_info, start_period, end_perio
# Calculate points for the retrieved round information
wallet_points, raw_points = round_point_computation(point_info, round_info, active_nodes)
update_wallet_country_list(active_nodes, wallet_list_path)
# Define Lists
positive = []
negative = []
......@@ -172,12 +170,14 @@ def round_point_computation(point_info, round_info, active_nodes):
raw_points_dict = {} # Dict of raw points (without multipliers) to print to a log file
node_multipliers = {} # Dictionary containing point multipliers for each node
node_wallets = {} # Dictionary parsed from active nodes to more efficiently associate ID with Wallet ID
node_countries = {}
# Parse active nodes into dictionaries
for row in active_nodes:
wallet_address = row[0]
node_id = bytes(row[1])
node_country = row[2] # Database query for country by node id
node_countries[node_id] = node_country
node_bin = country_bins[node_country] # Get bin associated with country
node_multipliers[node_id] = bin_multipliers[node_bin] # Assign multiplier to node
node_wallets[node_id] = wallet_address # Add wallet association for node id
......@@ -226,7 +226,7 @@ def round_point_computation(point_info, round_info, active_nodes):
wallet = node_wallets.get(bytes(node_id))
if wallet:
wallet_points[wallet] += points
raw_points_dict[wallet] += success_points
raw_points_dict[f"{wallet},{node_countries[bytes(node_id)]}"] += success_points
else:
log.warning(f"no wallet found for nid {bytes(node_id)}")
else:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment