From e500f4a100cd9b32f3c6fdf33d5089f0a3d23051 Mon Sep 17 00:00:00 2001 From: Brian Warner Date: Mon, 26 Dec 2016 15:27:14 -0500 Subject: [PATCH] rx: tolerate duplicate peer messages closes #121 --- src/wormhole/wormhole.py | 5 +++++ 1 file changed, 5 insertions(+) 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)