当我运行Python代码时,bitcoin-rpc importaddress错误

问题描述

当我创建test.py并运行此文件时。但是它显示了超时错误。 这是我的代码

from bitcoin.rpc import RawProxy
import socket

p = RawProxy()

timeout = 10000
socket.setdefaulttimeout(timeout)

p.importaddress("mmd963W1fECjLyaDCHcioSCZYHkRwjkGST","testaddress")

info = p.getbalances()

print(info)

这是我的错误日志

Traceback (most recent call last):
  File "test.py",line 9,in <module>
    p.importaddress("mmd963W1fECjLyaDCHcioSCZYHkRwjkGST","testaddress")
  File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/bitcoin/rpc.py",line 315,in <lambda>
    f = lambda *args: self._call(name,*args)
  File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/bitcoin/rpc.py",line 233,in _call
    response = self._get_response()
  File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/bitcoin/rpc.py",line 263,in _get_response
    http_response = self.__conn.getresponse()
  File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/http/client.py",line 1331,in getresponse
    response.begin()
  File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/http/client.py",line 297,in begin
    version,status,reason = self._read_status()
  File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/http/client.py",line 258,in _read_status
    line = str(self.fp.readline(_MAXLINE + 1),"iso-8859-1")
  File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/socket.py",line 586,in readinto
    return self._sock.recv_into(b)
socket.timeout: timed out

我该怎么办才能解决错误?? ...

请帮助我

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)