BUGFIX: confirmations & payment_history fixes.
[electrum-server.git] / backends / libbitcoin / history1 / __init__.py
1 import _history
2 from bitcoin import bind, _1, _2
3 import json
4
5 def wrap_finish(handle_finish, ec, result_json):
6     try:
7         result = json.loads(result_json)
8     except ValueError:
9         print result_json
10         raise
11     else:
12         handle_finish(ec, result)
13
14 def payment_history(service, chain, txpool, membuf, address, finish):
15     _history.payment_history(service.internal_ptr, chain.internal_ptr,
16                              txpool.internal_ptr, membuf.internal_ptr,
17                              str(address), bind(wrap_finish, finish, _1, _2))
18