Merge pull request #3140 from SomberNight/sweep_p2pk_unknown
fix: sweep p2pk - small display bug (unknown -> pubkey)
This commit is contained in:
commit
3696d38f33
|
@ -871,18 +871,17 @@ class Abstract_Wallet(PrintError):
|
||||||
return tx
|
return tx
|
||||||
|
|
||||||
def _append_utxos_to_inputs(self, inputs, network, pubkey, txin_type, imax):
|
def _append_utxos_to_inputs(self, inputs, network, pubkey, txin_type, imax):
|
||||||
address = None
|
|
||||||
if txin_type != 'p2pk':
|
if txin_type != 'p2pk':
|
||||||
address = bitcoin.pubkey_to_address(txin_type, pubkey)
|
address = bitcoin.pubkey_to_address(txin_type, pubkey)
|
||||||
sh = bitcoin.address_to_scripthash(address)
|
sh = bitcoin.address_to_scripthash(address)
|
||||||
else:
|
else:
|
||||||
script = bitcoin.public_key_to_p2pk_script(pubkey)
|
script = bitcoin.public_key_to_p2pk_script(pubkey)
|
||||||
sh = bitcoin.script_to_scripthash(script)
|
sh = bitcoin.script_to_scripthash(script)
|
||||||
|
address = '(pubkey)'
|
||||||
u = network.synchronous_get(('blockchain.scripthash.listunspent', [sh]))
|
u = network.synchronous_get(('blockchain.scripthash.listunspent', [sh]))
|
||||||
for item in u:
|
for item in u:
|
||||||
if len(inputs) >= imax:
|
if len(inputs) >= imax:
|
||||||
break
|
break
|
||||||
if address is not None:
|
|
||||||
item['address'] = address
|
item['address'] = address
|
||||||
item['type'] = txin_type
|
item['type'] = txin_type
|
||||||
item['prevout_hash'] = item['tx_hash']
|
item['prevout_hash'] = item['tx_hash']
|
||||||
|
|
Loading…
Reference in New Issue