mirror of
https://github.com/LBRYFoundation/LBRY-Vault.git
synced 2025-08-31 09:21:39 +00:00
signtransaction: pass pubkey to tx.sign (fix #5522)
This commit is contained in:
parent
1d637ef988
commit
b42009acb7
1 changed files with 2 additions and 4 deletions
|
@ -271,10 +271,8 @@ class Commands:
|
||||||
tx = Transaction(tx)
|
tx = Transaction(tx)
|
||||||
if privkey:
|
if privkey:
|
||||||
txin_type, privkey2, compressed = bitcoin.deserialize_privkey(privkey)
|
txin_type, privkey2, compressed = bitcoin.deserialize_privkey(privkey)
|
||||||
pubkey_bytes = ecc.ECPrivkey(privkey2).get_public_key_bytes(compressed=compressed)
|
pubkey = ecc.ECPrivkey(privkey2).get_public_key_bytes(compressed=compressed).hex()
|
||||||
h160 = bitcoin.hash_160(pubkey_bytes)
|
tx.sign({pubkey:(privkey2, compressed)})
|
||||||
x_pubkey = 'fd' + bh2u(b'\x00' + h160)
|
|
||||||
tx.sign({x_pubkey:(privkey2, compressed)})
|
|
||||||
else:
|
else:
|
||||||
self.wallet.sign_transaction(tx, password)
|
self.wallet.sign_transaction(tx, password)
|
||||||
return tx.as_dict()
|
return tx.as_dict()
|
||||||
|
|
Loading…
Add table
Reference in a new issue