Skip to content

Commit

Permalink
Namecoin: Use name_op from PartialTxInput in get_utxos
Browse files Browse the repository at this point in the history
  • Loading branch information
JeremyRand committed Feb 6, 2020
1 parent 4f1424e commit a4c7429
Showing 1 changed file with 6 additions and 15 deletions.
21 changes: 6 additions & 15 deletions electrum_nmc/electrum/address_synchronizer.py
Original file line number Diff line number Diff line change
Expand Up @@ -825,10 +825,7 @@ def get_utxos(self, domain=None, *, excluded_addresses=None,
and utxo.block_height + COINBASE_MATURITY > mempool_height):
continue
if not include_names:
txid = utxo.prevout.txid
vout = utxo.prevout.out_idx
name_op = self.db.transactions[txid].outputs()[vout].name_op
if name_op is not None:
if utxo.name_op is not None:
continue
# The only_uno_txids argument is used to search for name outputs
# from a specific list of txid's, and only return those utxo's.
Expand All @@ -837,22 +834,16 @@ def get_utxos(self, domain=None, *, excluded_addresses=None,
# name_firstupdate syntax (where only a txid is specified, not
# a txid+vout) we don't do that right now.
if only_uno_txids is not None:
txid = utxo.prevout.txid
vout = utxo.prevout.out_idx
name_op = self.db.transactions[txid].outputs()[vout].name_op
if name_op is None:
if utxo.name_op is None:
continue
if txid not in only_uno_txids:
if utxo.prevout.txid not in only_uno_txids:
continue
if only_uno_identifiers is not None:
txid = utxo.prevout.txid
vout = utxo.prevout.out_idx
name_op = self.db.transactions[txid].outputs()[vout].name_op
if name_op is None:
if utxo.name_op is None:
continue
if "name" not in name_op:
if "name" not in utxo.name_op:
continue
if name_op["name"] not in only_uno_identifiers:
if utxo.name_op["name"] not in only_uno_identifiers:
continue
coins.append(utxo)
continue
Expand Down

0 comments on commit a4c7429

Please sign in to comment.