perone / protocoin

A pure Python Bitcoin protocol implementation
http://protocoin.readthedocs.org/
BSD 4-Clause "Original" or "Old" License
98 stars 34 forks source link

clients.py: Error in close_stream, should be 'self' and not 'sel' in the statement 'sel.socket.close()' #8

Closed malheum closed 10 years ago

malheum commented 10 years ago

Hello,

in clients.py in the class BitcoinBasicClient is this class function:

def close_stream(self): """This method will close the socket stream.""" sel.socket.close()

Obviously this should be self.socket.close() and not sel.socket.close().

The error I got was this one:

('Message sent:', 'version') Traceback (most recent call last): File "./receive_test.py", line 33, in main() File "./receive_test.py", line 28, in main client.close_stream() File "/usr/local/lib/python2.7/dist-packages/protocoin-0.2-py2.7.egg/protocoin/clients.py", line 20, in close_stream sel.socket.close() NameError: global name 'sel' is not defined

Kind regards M

perone commented 10 years ago

Fixed, thanks for the report.