1
0

privacy analysis: detect address reuse

add tx position to get_addr_io
This commit is contained in:
ThomasV
2023-03-02 11:29:41 +01:00
parent 798cd607b5
commit 2ed71579c3
3 changed files with 47 additions and 20 deletions

View File

@@ -778,13 +778,13 @@ class AddressSynchronizer(Logger, EventListener):
sent = {}
for tx_hash, height in h:
hh, pos = self.get_txpos(tx_hash)
assert hh == height
d = self.db.get_txo_addr(tx_hash, address)
for n, (v, is_cb) in d.items():
received[tx_hash + ':%d'%n] = (height, pos, v, is_cb)
for tx_hash, height in h:
l = self.db.get_txi_addr(tx_hash, address)
for txi, v in l:
sent[txi] = tx_hash, height
sent[txi] = tx_hash, height, pos
return received, sent
def get_addr_outputs(self, address: str) -> Dict[TxOutpoint, PartialTxInput]:
@@ -799,7 +799,7 @@ class AddressSynchronizer(Logger, EventListener):
utxo.block_height = tx_height
utxo.block_txpos = tx_pos
if prevout_str in sent:
txid, height = sent[prevout_str]
txid, height, pos = sent[prevout_str]
utxo.spent_txid = txid
utxo.spent_height = height
else: