Skip to content

Commit

Permalink
Namecoin: Add "commitment" output field to name_new
Browse files Browse the repository at this point in the history
Avoids forcing the user to run the deserialize command when giving a
commitment to a counterparty.
  • Loading branch information
JeremyRand committed Dec 19, 2021
1 parent 08e6262 commit 6f27d9d
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion electrum_nmc/electrum/commands.py
Expand Up @@ -792,6 +792,7 @@ async def name_new(self, identifier=None, commitment=None, destination=None, amo
if identifier is not None:
name_op, salt = build_name_new(identifier_bytes, address=destination, password=password, wallet=wallet)
salt_hex = bh2u(salt)
commitment = bh2u(name_op["commitment"])
else:
name_op, salt = {"op": OP_NAME_NEW, "commitment": bfh(commitment)}, None
salt_hex = None
Expand All @@ -818,7 +819,7 @@ async def name_new(self, identifier=None, commitment=None, destination=None, amo
rbf=rbf,
password=password,
locktime=locktime)
return {"tx": tx.serialize(), "txid": tx.txid(), "salt": salt_hex}
return {"tx": tx.serialize(), "txid": tx.txid(), "salt": salt_hex, "commitment": commitment}

@command('wp')
async def name_firstupdate(self, identifier, salt=None, name_new_txid=None, value="", destination=None, amount=0.0, outputs=[], fee=None, feerate=None, from_addr=None, from_coins=None, change_addr=None, nocheck=False, unsigned=False, rbf=None, password=None, locktime=None, allow_early=False, wallet: Abstract_Wallet = None):
Expand Down

0 comments on commit 6f27d9d

Please sign in to comment.