connector

This commit is contained in:
4tochka 2019-05-09 13:06:06 +04:00
parent 2b35103880
commit f97338ba73
2 changed files with 11 additions and 8 deletions

View File

@ -597,7 +597,7 @@ class Connector:
for i in tx["vIn"]:
outpoint = b"".join((inp["txId"], int_to_bytes(inp["vOut"])))
try:
stxo.add(outpoint, tx["vIn"][i]["__coin__"])
stxo.add(outpoint, tx["vIn"][i]["_c_"])
except:
inp = tx["vIn"][i]
r = self.utxo.get(outpoint, block_height)
@ -618,7 +618,7 @@ class Connector:
if self.utxo:
for i in tx["vOut"]:
try:
tx["vOut"][i]["__spent__"]
tx["vOut"][i]["_s_"]
except:
out = tx["vOut"][i]
# if self.skip_opreturn and out["nType"] in (3, 8):

View File

@ -227,10 +227,12 @@ class Worker:
for i in block["rawTx"][z]["vIn"]:
inp = block["rawTx"][z]["vIn"][i]
outpoint = b"".join((inp["txId"], int_to_bytes(inp["vOut"])))
r = self.coins[outpoint]
if r:
block["rawTx"][z]["vIn"][i]["_c_"] = r
self.destroyed_coins[outpoint] = True
try:
r = self.coins[outpoint]
block["rawTx"][z]["vIn"][i]["_c_"] = r
self.destroyed_coins[r[0]] = True
except:
pass
for i in block["rawTx"][z]["vOut"]:
o = b"".join((block["rawTx"][z]["txId"], int_to_bytes(i)))
pointer = (x << 42) + (z << 21) + i
@ -244,9 +246,10 @@ class Worker:
for x in blocks:
for y in blocks[x]["rawTx"]:
for i in blocks[x]["rawTx"][y]["vOut"]:
if self.destroyed_coins[pointer]:
try:
pointer = (x << 42) + (y << 21) + i
blocks[x]["rawTx"][y]["vOut"][i]["_s_"] = 1
blocks[x]["rawTx"][y]["vOut"][i]["_s_"] = self.destroyed_coins[pointer]
except: pass
blocks[x] = pickle.dumps(blocks[x])
# self.log.critical(str(len(blocks)))
self.pipe_sent_msg(b'result', pickle.dumps(blocks))