Skip to content

Commit

Permalink
Namecoin: Use TxOutpoint in names.py
Browse files Browse the repository at this point in the history
  • Loading branch information
JeremyRand committed Feb 10, 2020
1 parent 419896e commit 9deb7bb
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions electrum_nmc/electrum/names.py
Original file line number Diff line number Diff line change
Expand Up @@ -342,8 +342,8 @@ def get_queued_firstupdate_from_new(wallet, txid, idx):
# Look at all the candidate's inputs to make sure it's
# actually spending the NAME_NEW
for addr_tx_input in addr_tx.inputs():
if addr_tx_input['prevout_hash'] == txid:
if addr_tx_input['prevout_n'] == idx:
if addr_tx_input.prevout.txid == txid:
if addr_tx_input.prevout.out_idx == idx:
# We've confirmed that it spends the NAME_NEW.
# Look at the outputs to find the
# NAME_FIRSTUPDATE.
Expand Down Expand Up @@ -387,12 +387,12 @@ def get_wallet_name_count(wallet, network):

utxos = wallet.get_utxos()
for _, x in enumerate(utxos):
txid = x.get('prevout_hash')
vout = x.get('prevout_n')
txid = x.prevout.txid
vout = x.prevout.out_idx
name_op = wallet.db.transactions[txid].outputs()[vout].name_op
if name_op is None:
continue
height = x.get('height')
height = x.block_height
chain_height = network.blockchain().height()
expires_in = name_expires_in(height, chain_height)
if expires_in is None:
Expand Down

0 comments on commit 9deb7bb

Please sign in to comment.