X-Git-Url: https://git.novaco.in/?a=blobdiff_plain;f=modules%2Fpython_bitcoin%2Fcomposed.py;h=e36f151a9c37a5bb7045d385fb844a86ec8478b5;hb=22515839af33f8014d0f509a1bdce6abbaaa5c04;hp=5f17d7081632f6e49e041be73a819d60ac2ce6f3;hpb=84ce3f841211f5a122524a4caf98687a1c21fe7e;p=electrum-server.git diff --git a/modules/python_bitcoin/composed.py b/modules/python_bitcoin/composed.py index 5f17d70..e36f151 100644 --- a/modules/python_bitcoin/composed.py +++ b/modules/python_bitcoin/composed.py @@ -73,7 +73,8 @@ class PaymentHistory: else: statement_line.input_point = inpoint self.finish_if_done() - self.load_tx_info(inpoint, statement_line, True) + if not ec: + self.load_tx_info(inpoint, statement_line, True) def finish_if_done(self): with self.lock: @@ -81,8 +82,9 @@ class PaymentHistory: return result = [] for line in self.statement: - line.input_loaded["value"] = -line.output_loaded["value"] - result.append(line.input_loaded) + if line.input_point: + line.input_loaded["value"] = -line.output_loaded["value"] + result.append(line.input_loaded) result.append(line.output_loaded) self.handle_finish(result) self.stop() @@ -170,11 +172,14 @@ def payment_history(chain, address, handle_finish): if __name__ == "__main__": def finish(result): print result + def last(ec, depth): + print "D:", depth service = bitcoin.async_service(1) prefix = "/home/genjix/libbitcoin/database" chain = bitcoin.bdb_blockchain(service, prefix) - address = "1LzBzVqEeuQyjD2mRWHes3dgWrT9titxvq" + chain.fetch_last_depth(last) + address = "1Pbn3DLXfjqF1fFV9YPdvpvyzejZwkHhZE" print "Looking up", address payment_history(chain, address, finish) raw_input()