connector

This commit is contained in:
4tochka 2019-05-17 14:47:06 +04:00
parent 14edc4e8d8
commit 78742525f8
2 changed files with 15 additions and 19 deletions

View File

@ -248,11 +248,7 @@ class Worker:
outpoint = b"".join((inp["txId"], int_to_bytes(inp["vOut"]))) outpoint = b"".join((inp["txId"], int_to_bytes(inp["vOut"])))
try: try:
r = self.coins.delete(outpoint) r = self.coins.delete(outpoint)
h = r[0] >> 42 block["rawTx"][z]["vIn"][i]["_c_"] = r
if h >= start_height and h < height:
block["rawTx"][z]["vIn"][i]["_a_"] = r
else:
block["rawTx"][z]["vIn"][i]["_c_"] = r
t += 1 t += 1
self.destroyed_coins[r[0]] = True self.destroyed_coins[r[0]] = True
except: except:

View File

@ -621,21 +621,21 @@ class Connector:
c += 1 c += 1
self.yy += 1 self.yy += 1
except: except:
try: # try:
tx["vIn"][i]["coin"] = inp["_a_"] # tx["vIn"][i]["coin"] = inp["_a_"]
# c += 1
# self.aa += 1
# try:
# self.utxo.get(outpoint)
# except:
# self.utxo.deleted.add(outpoint)
# except:
r = self.utxo.get(outpoint)
if r:
tx["vIn"][i]["coin"] = r
c += 1 c += 1
self.aa += 1 else:
try: missed.add((outpoint, (block_height << 42) + (block_index << 21) + i, i))
self.utxo.get(outpoint)
except:
self.utxo.deleted.add(outpoint)
except:
r = self.utxo.get(outpoint)
if r:
tx["vIn"][i]["coin"] = r
c += 1
else:
missed.add((outpoint, (block_height << 42) + (block_index << 21) + i, i))
if missed: if missed:
await self.utxo.load_utxo() await self.utxo.load_utxo()