connector

This commit is contained in:
4tochka 2019-05-17 16:39:01 +04:00
parent d55db7af2b
commit 63a284db65
2 changed files with 28 additions and 18 deletions

View File

@ -258,7 +258,10 @@ class Worker:
outpoint = b"".join((inp["txId"], int_to_bytes(inp["vOut"])))
try:
r = self.coins.delete(outpoint)
block["rawTx"][z]["vIn"][i]["_c_"] = r
if r[0] >> 42 >= start_height and r[0] < height:
block["rawTx"][z]["vIn"][i]["_a_"] = r
else:
block["rawTx"][z]["vIn"][i]["_c_"] = r
t += 1
self.destroyed_coins[r[0]] = True
except:
@ -276,14 +279,14 @@ class Worker:
self.a_coins[pointer]=True
blocks[x]["rawTx"][y]["vOut"][i]["_s_"] = r
except: pass
if not blocks[x]["rawTx"][y]["coinbase"]:
for i in blocks[x]["rawTx"][y]["vOut"]:
try:
r = blocks[x]["rawTx"][y]["vIn"][i]["_c_"]
self.a_coins.delete(r[0])
blocks[x]["rawTx"][y]["vIn"][i]["_a_"] = True
except:
pass
# if not blocks[x]["rawTx"][y]["coinbase"]:
# for i in blocks[x]["rawTx"][y]["vOut"]:
# try:
# r = blocks[x]["rawTx"][y]["vIn"][i]["_c_"]
# self.a_coins.delete(r[0])
# blocks[x]["rawTx"][y]["vIn"][i]["_a_"] = True
# except:
# pass
blocks[x] = pickle.dumps(blocks[x])
self.pipe_sent_msg(b'result', pickle.dumps(blocks))

View File

@ -617,18 +617,25 @@ class Connector:
outpoint = b"".join((inp["txId"], int_to_bytes(inp["vOut"])))
tx["vIn"][i]["outpoint"] = outpoint
try:
# inp["_a_"]
tx["vIn"][i]["coin"] = inp["_c_"]
tx["vIn"][i]["coin"] = inp["_a_"]
c += 1
self.yy += 1
self.utxo.deleted.add(outpoint)
self.aa += 1
except:
r = self.utxo.get(outpoint)
if r:
tx["vIn"][i]["coin"] = r
try:
tx["vIn"][i]["coin"] = inp["_c_"]
c += 1
else:
missed.add((outpoint, (block_height << 42) + (block_index << 21) + i, i))
self.yy += 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
else:
missed.add((outpoint, (block_height << 42) + (block_index << 21) + i, i))
if missed:
await self.utxo.load_utxo()