diff --git a/src/wormhole/wormhole.py b/src/wormhole/wormhole.py index 93d95b8..3c0830e 100644 --- a/src/wormhole/wormhole.py +++ b/src/wormhole/wormhole.py @@ -758,10 +758,15 @@ class _Wormhole: if self._closing: log.msg("received peer message while closing '%s'" % phase) + if phase in self._received_messages: + log.msg("ignoring duplicate peer message '%s'" % phase) + return if phase == "pake": + self._received_messages["pake"] = body return self._event_received_pake(body) if phase == "version": + self._received_messages["version"] = body return self._event_received_version(side, body) if re.search(r'^\d+$', phase): return self._event_received_phase_message(side, phase, body)