Skip to content

Commit

Permalink
FIXUP name_list usage
Browse files Browse the repository at this point in the history
  • Loading branch information
JeremyRand committed May 3, 2020
1 parent 3c47d17 commit a3cb620
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions electrum_nmc/electrum/commands.py
Original file line number Diff line number Diff line change
Expand Up @@ -955,13 +955,13 @@ async def name_autorenew(self, identifier, blocks_to_renew, blocks_before_expire
blocks_between_renewals = constants.net.NAME_EXPIRATION - blocks_before_expire
renewals_count = ceil(blocks_to_renew / blocks_between_renewals)

list_results = await self.name_list(identifier, wallet=wallet)
list_results = list_results[0]

# Allow renewing a name without any value changes by omitting the
# value.
renew = False
if value is None:
list_results = await self.name_list(identifier, wallet=wallet)
list_results = list_results[0]

# This check is in place to prevent an attack where an ElectrumX
# server supplies an unconfirmed name_update transaction with a
# malicious value and then tricks the wallet owner into signing a
Expand Down Expand Up @@ -996,9 +996,8 @@ async def name_autorenew(self, identifier, blocks_to_renew, blocks_before_expire
# Create the renewal transactions
extra_input_amount = 0.0
extra_input_present = False
init_update = self.name_list(identifier, wallet=wallet)[0]
init_address = init_update["address"]
init_txid = init_update["txid"]
init_address = list_results["address"]
init_txid = list_results["txid"]
while True:
renew_txs = []
try:
Expand Down

0 comments on commit a3cb620

Please sign in to comment.