Skip to content

Commit

Permalink
Namecoin: Use queued firstupdate's sendWhen depth for ETA
Browse files Browse the repository at this point in the history
  • Loading branch information
JeremyRand committed Feb 17, 2020
1 parent 8f57aa8 commit b655f3d
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
10 changes: 5 additions & 5 deletions electrum_nmc/electrum/gui/qt/uno_list.py
Original file line number Diff line number Diff line change
Expand Up @@ -92,15 +92,15 @@ def insert_utxo(self, idx, utxo: PartialTxInput):

if 'name' not in name_op:
# utxo is name_new
firstupdate_output = get_queued_firstupdate_from_new(self.wallet, txid, vout)
queue_item, firstupdate_output = get_queued_firstupdate_from_new(self.wallet, txid, vout)
if firstupdate_output is not None:
if firstupdate_output.name_op is not None:
name_op = firstupdate_output.name_op
expires_in, expires_datetime = None, None
if height is not None and header_at_tip is not None:
# TODO: Namecoin: Use queued transaction's minimum
# confirmations instead of hardcoding to 12.
status = _('Registration Pending, ETA ') + str(10 * (height - header_at_tip['block_height'] + 12)) + _("min")

if height is not None and header_at_tip is not None and queue_item is not None:
sendwhen_depth = queue_item["sendWhen"]["confirmations"]
status = _('Registration Pending, ETA ') + str(10 * (height - header_at_tip['block_height'] + sendwhen_depth)) + _("min")
else:
status = _('Registration Pending')
else:
Expand Down
6 changes: 3 additions & 3 deletions electrum_nmc/electrum/names.py
Original file line number Diff line number Diff line change
Expand Up @@ -314,7 +314,7 @@ def get_default_name_tx_label(wallet, tx):
return "Pre-Registration: " + format_name_identifier(addr_tx_output.name_op['name'])

# Look for queued transactions that spend the NAME_NEW
addr_tx_output = get_queued_firstupdate_from_new(wallet, tx.txid(), idx)
_, addr_tx_output = get_queued_firstupdate_from_new(wallet, tx.txid(), idx)
if addr_tx_output is not None:
return "Pre-Registration: " + format_name_identifier(addr_tx_output.name_op['name'])

Expand Down Expand Up @@ -352,8 +352,8 @@ def get_queued_firstupdate_from_new(wallet, txid, idx):
# We've found a name output; now we
# check for an identifier.
if 'name' in addr_tx_output.name_op:
return addr_tx_output
return None
return addr_tx_queue_item, addr_tx_output
return None, None


def get_wallet_name_delta(wallet, tx):
Expand Down

0 comments on commit b655f3d

Please sign in to comment.