connector
This commit is contained in:
parent
dca0bc2c59
commit
d55db7af2b
@ -243,6 +243,15 @@ class Worker:
|
|||||||
if y["result"] is not None:
|
if y["result"] is not None:
|
||||||
block = decode_block_tx(y["result"])
|
block = decode_block_tx(y["result"])
|
||||||
for z in block["rawTx"]:
|
for z in block["rawTx"]:
|
||||||
|
for i in block["rawTx"][z]["vOut"]:
|
||||||
|
o = b"".join((block["rawTx"][z]["txId"], int_to_bytes(i)))
|
||||||
|
pointer = (x << 42) + (z << 21) + i
|
||||||
|
try:
|
||||||
|
address = block["rawTx"][z]["vOut"][i]["scriptPubKey"]
|
||||||
|
except:
|
||||||
|
address = b"".join((bytes([block["rawTx"][z]["vOut"][i]["nType"]]),
|
||||||
|
block["rawTx"][z]["vOut"][i]["addressHash"]))
|
||||||
|
self.coins[o] = (pointer, block["rawTx"][z]["vOut"][i]["value"], address)
|
||||||
if not block["rawTx"][z]["coinbase"]:
|
if not block["rawTx"][z]["coinbase"]:
|
||||||
for i in block["rawTx"][z]["vIn"]:
|
for i in block["rawTx"][z]["vIn"]:
|
||||||
inp = block["rawTx"][z]["vIn"][i]
|
inp = block["rawTx"][z]["vIn"][i]
|
||||||
@ -254,15 +263,7 @@ class Worker:
|
|||||||
self.destroyed_coins[r[0]] = True
|
self.destroyed_coins[r[0]] = True
|
||||||
except:
|
except:
|
||||||
pass
|
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
|
|
||||||
try:
|
|
||||||
address = block["rawTx"][z]["vOut"][i]["scriptPubKey"]
|
|
||||||
except:
|
|
||||||
address = b"".join((bytes([block["rawTx"][z]["vOut"][i]["nType"]]),
|
|
||||||
block["rawTx"][z]["vOut"][i]["addressHash"]))
|
|
||||||
self.coins[o] = (pointer, block["rawTx"][z]["vOut"][i]["value"], address)
|
|
||||||
blocks[x] = block
|
blocks[x] = block
|
||||||
if blocks:
|
if blocks:
|
||||||
blocks[x]["checkpoint"] = x
|
blocks[x]["checkpoint"] = x
|
||||||
|
|||||||
@ -621,22 +621,14 @@ class Connector:
|
|||||||
tx["vIn"][i]["coin"] = inp["_c_"]
|
tx["vIn"][i]["coin"] = inp["_c_"]
|
||||||
c += 1
|
c += 1
|
||||||
self.yy += 1
|
self.yy += 1
|
||||||
|
self.utxo.deleted.add(outpoint)
|
||||||
except:
|
except:
|
||||||
try:
|
r = self.utxo.get(outpoint)
|
||||||
tx["vIn"][i]["coin"] = inp["_c_"]
|
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()
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user