Skip to content

Commit

Permalink
register name after gifting
Browse files Browse the repository at this point in the history
  • Loading branch information
robertmin1 committed May 16, 2024
1 parent 0808997 commit f784cae
Showing 1 changed file with 26 additions and 0 deletions.
26 changes: 26 additions & 0 deletions electrum_nmc/electrum/commands.py
Original file line number Diff line number Diff line change
Expand Up @@ -1094,6 +1094,32 @@ async def name_autoregister(self, identifier, value="", name_encoding='ascii', v
# without losing money in fees.
validate_value_length(value)

# Check whether a name_new is already in the wallet for that name
try:
firstupdate_tx = await self.name_firstupdate(identifier,
None,
None,
value=value,
name_encoding=name_encoding,
value_encoding=value_encoding,
destination=destination,
amount=amount,
fee=fee,
feerate=feerate,
from_addr=None,
change_addr=change_addr,
pseudonymous_identifier=pseudonymous_identifier,
nocheck=nocheck,
rbf=rbf,
password=password,
locktime=locktime,
allow_early=True,
wallet=wallet)
# TODO: Implement queuetransaction later
await self.broadcast(firstupdate_tx, stream_id=stream_id)
except NamePreRegistrationNotFound:
pass

# TODO: Don't hardcode the 0.005 name_firstupdate fee
new_result = await self.name_new(identifier,
name_encoding=name_encoding,
Expand Down

0 comments on commit f784cae

Please sign in to comment.