|
|
|
@ -151,14 +151,12 @@ class Transaction(object):
|
|
|
|
|
|
|
|
|
|
if on_chain_vt:
|
|
|
|
|
shared_secret = ed25519.scalarmult(svk_8, tx_key)
|
|
|
|
|
vt_hsdata = b"".join([
|
|
|
|
|
"view_tag", # need to make sure to only take first 8 bytes of this string
|
|
|
|
|
vt_hsdata = b"view_tag" + b"".join([
|
|
|
|
|
shared_secret,
|
|
|
|
|
varint.encode(idx)
|
|
|
|
|
])
|
|
|
|
|
vt_full = keccak_256(vt_hsdata).digest()
|
|
|
|
|
vt = vt_full[0] # the view tag is the first byte of vt_full
|
|
|
|
|
|
|
|
|
|
vt = binascii.hexlify(vt_full)[0:2]
|
|
|
|
|
if vt != on_chain_vt:
|
|
|
|
|
continue
|
|
|
|
|
else:
|
|
|
|
@ -175,11 +173,6 @@ class Transaction(object):
|
|
|
|
|
)
|
|
|
|
|
if k != stealth_address:
|
|
|
|
|
continue
|
|
|
|
|
hsdata = b"".join([
|
|
|
|
|
shared_secret,
|
|
|
|
|
varint.encode(idx),
|
|
|
|
|
])
|
|
|
|
|
Hs_ur = keccak_256(hsdata).digest()
|
|
|
|
|
if not encamount:
|
|
|
|
|
# Tx ver 1
|
|
|
|
|
return Payment(
|
|
|
|
@ -247,6 +240,8 @@ class Transaction(object):
|
|
|
|
|
#pre fork transaction
|
|
|
|
|
stealth_address = binascii.unhexlify(vout["target"]["key"])
|
|
|
|
|
on_chain_vt = False
|
|
|
|
|
pass
|
|
|
|
|
|
|
|
|
|
encamount = None
|
|
|
|
|
if self.version == 2 and not self.is_coinbase:
|
|
|
|
|
encamount = binascii.unhexlify(
|
|
|
|
@ -280,7 +275,6 @@ class Transaction(object):
|
|
|
|
|
def __repr__(self):
|
|
|
|
|
return self.hash
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class Output(object):
|
|
|
|
|
"""
|
|
|
|
|
A Monero one-time public output (A.K.A stealth address).
|
|
|
|
|