X-Git-Url: https://git.novaco.in/?p=electrum-server.git;a=blobdiff_plain;f=backends%2Flibbitcoin%2Fhistory1%2F__init__.py;h=3bce9ab03bda6e81a1d75a592bc7fad00673efca;hp=25cd9e6e360a218d85fa0d361fcee55141487aa1;hb=4565e5be9d30d3d28f9319f613cd5311081fc4d7;hpb=608eb0b73118735c11f10468b51d607ac6d02232 diff --git a/backends/libbitcoin/history1/__init__.py b/backends/libbitcoin/history1/__init__.py index 25cd9e6..3bce9ab 100644 --- a/backends/libbitcoin/history1/__init__.py +++ b/backends/libbitcoin/history1/__init__.py @@ -3,10 +3,16 @@ from bitcoin import bind, _1, _2 import json def wrap_finish(handle_finish, ec, result_json): - handle_finish(ec, json.loads(result_json)) + try: + result = json.loads(result_json) + except ValueError: + print result_json + raise + else: + handle_finish(ec, result) def payment_history(service, chain, txpool, membuf, address, finish): _history.payment_history(service.internal_ptr, chain.internal_ptr, txpool.internal_ptr, membuf.internal_ptr, - address, bind(wrap_finish, finish, _1, _2)) + str(address), bind(wrap_finish, finish, _1, _2))