From 9439b3d1fd8388f78dea0a2d4f537982ce833365 Mon Sep 17 00:00:00 2001 From: 4tochka Date: Thu, 9 May 2019 15:20:52 +0400 Subject: [PATCH] connector --- pybtc/connector/connector.py | 25 ++++++++++++------------- 1 file changed, 12 insertions(+), 13 deletions(-) diff --git a/pybtc/connector/connector.py b/pybtc/connector/connector.py index 8a4d278..19909d4 100644 --- a/pybtc/connector/connector.py +++ b/pybtc/connector/connector.py @@ -612,19 +612,18 @@ class Connector: if self.utxo: for i in tx["vOut"]: - # try: - # tx["vOut"][i]["_s_"] - # self.tt += 1 - # except: - out = tx["vOut"][i] - # if self.skip_opreturn and out["nType"] in (3, 8): - # continue - pointer = (block_height << 42) + (block_index << 21) + i - try: - address = out["scriptPubKey"] - except: - address = b"".join((bytes([out["nType"]]), out["addressHash"])) - self.utxo.set(b"".join((tx["txId"], int_to_bytes(i))), pointer, out["value"], address) + if "_s_" in tx["vOut"][i]: + self.tt += 1 + else: + out = tx["vOut"][i] + # if self.skip_opreturn and out["nType"] in (3, 8): + # continue + pointer = (block_height << 42) + (block_index << 21) + i + try: + address = out["scriptPubKey"] + except: + address = b"".join((bytes([out["nType"]]), out["addressHash"])) + self.utxo.set(b"".join((tx["txId"], int_to_bytes(i))), pointer, out["value"], address) self.tx_cache.set(tx["txId"], True) try: