From c96bba3213db866bcca0aa01325cb73d3da1a823 Mon Sep 17 00:00:00 2001 From: 4tochka Date: Mon, 27 May 2019 23:37:38 +0400 Subject: [PATCH] connector --- pybtc/connector/utxo.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/pybtc/connector/utxo.py b/pybtc/connector/utxo.py index 6ab717f..f4d35f5 100644 --- a/pybtc/connector/utxo.py +++ b/pybtc/connector/utxo.py @@ -154,21 +154,21 @@ class UTXO(): try: self.load_utxo_future = asyncio.Future() l = set(self.missed) - rows = [] - [rows.append({"outpoint": k, "data": self.db.get(k)}) for k in l] + rows = self.db.multi_get(l) + for i in l: try: self.missed.remove(i) except: pass - for row in rows: - d = row["data"] + for outpoint in rows: + d = rows[outpoint] pointer = c_int_to_int(d) f = c_int_len(pointer) amount = c_int_to_int(d[f:]) f += c_int_len(amount) address = d[f:] - self.loaded[row["outpoint"]] = (pointer, amount, address) + self.loaded[outpoint] = (pointer, amount, address) self.loaded_utxo += 1 finally: self.load_utxo_future.set_result(True)