jgarzik / python-bitcoinrpc

Python interface to bitcoin's JSON-RPC API
GNU Lesser General Public License v2.1
644 stars 304 forks source link

Bug in __call__ related to bitcoind returning a bogus error #60

Closed arnuschky closed 8 years ago

arnuschky commented 8 years ago

bitcoind returns an error when it actually wants to return a warning: https://github.com/bitcoin/bitcoin/issues/7130 This causes a connection result with error=None as shown below. Unfortunately, python-bitcoinrpc misbehaves in this case, neither throwing an exception nor returning the result.

Two ways to fix this:

The second case works with bitcoind's weird warning behavior. It's fixed by https://github.com/jgarzik/python-bitcoinrpc/pull/59

{u'error': None,
 u'id': 1,
 u'result': {u'balance': Decimal('1.69743172'),
             u'blocks': 385893,
             u'connections': 8,
             u'difficulty': Decimal('72722780642.54718018'),
             u'errors': u'Warning: This version is obsolete; upgrade required!',
             u'keypoololdest': 1423141169,
             u'keypoolsize': 10001,
             u'paytxfee': Decimal('0E-8'),
             u'protocolversion': 70002,
             u'proxy': u'',
             u'relayfee': Decimal('0.00005000'),
             u'testnet': False,
             u'timeoffset': 0,
             u'unlocked_until': 0,
             u'version': 110100,
             u'walletversion': 60000}}
tpainter commented 8 years ago

This issue is keeping any bitcoinrpc calls from working for me. All calls either return an error (if they are supposed to) or they return "none". This includes basic calls like '.getinfo()'

The fix in the pull request allows me to use rpc calls as they are meant to be used.

Note: This is on windows 10 communicating with local Bitcoin Core 0.11.2.

jojva commented 8 years ago

This issue is also keeping me from making any bitcoinrpc calls. Using the PR patch like the others until it is merged.

jgarzik commented 8 years ago

Fixed by #59