BUGFIX: confirmations & payment_history fixes.
[electrum-server.git] / backends / libbitcoin / history1 / __init__.py
index 25cd9e6..3bce9ab 100644 (file)
@@ -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))