From a3cb620b080657b3d3d8bb9e37f7f19f79c73ea1 Mon Sep 17 00:00:00 2001 From: JeremyRand Date: Sun, 3 May 2020 12:25:48 +0000 Subject: [PATCH] FIXUP name_list usage --- electrum_nmc/electrum/commands.py | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/electrum_nmc/electrum/commands.py b/electrum_nmc/electrum/commands.py index 521826c5919d..e032cd6d2b99 100644 --- a/electrum_nmc/electrum/commands.py +++ b/electrum_nmc/electrum/commands.py @@ -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 @@ -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: