mirror of
https://github.com/aljazceru/python-teos.git
synced 2025-12-17 22:24:23 +01:00
plugin - repurpose invalid_appointments and adds misbehaving_proof
invalid_appointments in TowerInfo was used to stored invalid appointment responses from the tower when it was misbehaving (i.e. wrong or missing signature). However, a single item was stored since the tower is abandoned after misbehaving. data reported as invalid by the tower was not backed up. invalid_appointments now stores the appointment rejected by the tower and reported as invalid. misbehaving_proof stores the proof of misbehaviour by the tower (single item)
This commit is contained in:
@@ -63,7 +63,11 @@ class Retrier:
|
||||
|
||||
except SignatureError as e:
|
||||
tower_update["status"] = "misbehaving"
|
||||
tower_update["invalid_appointment"] = (appointment_dict, e.kwargs.get("signature"))
|
||||
tower_update["misbehaving_proof"] = {
|
||||
"appointment": appointment_dict,
|
||||
"signature": e.kwargs.get("signature"),
|
||||
"recovered_id": e.kwargs.get("recovered_id"),
|
||||
}
|
||||
|
||||
except TowerConnectionError:
|
||||
tower_update["status"] = "temporarily unreachable"
|
||||
@@ -71,6 +75,9 @@ class Retrier:
|
||||
except TowerResponseError as e:
|
||||
tower_update["status"] = e.kwargs.get("status")
|
||||
|
||||
if e.kwargs.get("invalid_appointment"):
|
||||
tower_update["invalid_appointment"] = (appointment_dict, signature)
|
||||
|
||||
if tower_update["status"] in ["reachable", "misbehaving"]:
|
||||
tower_update["pending_appointment"] = ([appointment_dict, signature], "remove")
|
||||
|
||||
|
||||
Reference in New Issue
Block a user