From 513e5bed6ec47456675baa3c45b5767fca878948 Mon Sep 17 00:00:00 2001 From: meejah Date: Sun, 18 Apr 2021 21:13:45 -0600 Subject: [PATCH] combine checks --- src/wormhole_transit_relay/server_state.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/wormhole_transit_relay/server_state.py b/src/wormhole_transit_relay/server_state.py index f851b91..6018252 100644 --- a/src/wormhole_transit_relay/server_state.py +++ b/src/wormhole_transit_relay/server_state.py @@ -305,9 +305,8 @@ class TransitServerState(object): @_machine.output() def _record_usage(self): if self._mood == "jilted": - if self._buddy: - if self._buddy._mood == "happy": - return + if self._buddy and self._buddy._mood == "happy": + return self._usage.record( started=self._client.started_time, buddy_started=self._buddy._client.started_time if self._buddy is not None else None,