[pypy-issue] Issue #1981: Socket timeouts with the bitcoin-python library (pypy/pypy)

Ivan Voras issues-reply at bitbucket.org
Wed Feb 11 23:21:51 CET 2015


New issue 1981: Socket timeouts with the bitcoin-python library
https://bitbucket.org/pypy/pypy/issue/1981/socket-timeouts-with-the-bitcoin-python

Ivan Voras:

The bitcoin-python library is a relatively thin wrapper over the bitcoind JSON RPC API. However, after performing some operations, it simply hangs / timeouts on random operations when used with pypy (of course, it works on CPython). The library is pure Python and available here: http://laanwj.github.io/bitcoin-python/ (it's normally installable via pip, etc.).

The following simple script demonstrates the problem:

```
from time import time
import bitcoinrpc

conn = bitcoinrpc.connect_to_local()

t1 = time()
for x in range(1000):
#    print x
    tx = conn.getrawtransaction('a79ffa13308ffc5ff5d157f2f86187d48bdff44e09071b808e5ce6eda7468571', 1)
t2 = time()
print tx
print t2 - t1
```

When run on CPython, it will complete without problems. When run under PyPy, it will hang after about 30 iterations.

Unfortunately, running the above code will require that a bitcoin client (qt or cli) is running on the local machine and has RPC enabled, as well as a full database index...





More information about the pypy-issue mailing list