From: Forrest Voight Date: Sat, 11 Feb 2012 04:31:41 +0000 (-0500) Subject: rewrote p2p.Protocol.dataReceived. what was i thinking? X-Git-Tag: 0.8.5~2 X-Git-Url: https://git.novaco.in/?a=commitdiff_plain;h=aa520c1f00f19784a8d432243757a1b7c2feb446;p=p2pool.git rewrote p2p.Protocol.dataReceived. what was i thinking? --- diff --git a/p2pool/p2p.py b/p2pool/p2p.py index 8bd6800..b41bd32 100644 --- a/p2pool/p2p.py +++ b/p2pool/p2p.py @@ -59,7 +59,11 @@ class Protocol(bitcoin_p2p.BaseProtocol): self.timeout_delayed = reactor.callLater(100, self._timeout) old_dataReceived = self.dataReceived - self.dataReceived = lambda data: (self.timeout_delayed.reset(100) if not self.timeout_delayed.called else None, old_dataReceived(data))[0] + def new_dataReceived(data): + if not self.timeout_delayed.called: + self.timeout_delayed.reset(100) + old_dataReceived(data) + self.dataReceived = new_dataReceived def _connect_timeout(self): if not self.connected2 and self.transport.connected: