fix: seed, password
This commit is contained in:
@@ -137,7 +137,7 @@ class Commands:
|
|||||||
|
|
||||||
def signrawtransaction(self, raw_tx, input_info, private_keys):
|
def signrawtransaction(self, raw_tx, input_info, private_keys):
|
||||||
tx = Transaction(raw_tx)
|
tx = Transaction(raw_tx)
|
||||||
self.wallet.signrawtransaction(tx, input_info, private_keys)
|
self.wallet.signrawtransaction(tx, input_info, private_keys, self.password)
|
||||||
return tx.as_dict()
|
return tx.as_dict()
|
||||||
|
|
||||||
def decoderawtransaction(self, raw):
|
def decoderawtransaction(self, raw):
|
||||||
|
|||||||
@@ -236,8 +236,10 @@ class Wallet:
|
|||||||
out[address] = pk
|
out[address] = pk
|
||||||
return out
|
return out
|
||||||
|
|
||||||
def signrawtransaction(self, tx, input_info, private_keys):
|
|
||||||
|
def signrawtransaction(self, tx, input_info, private_keys, password):
|
||||||
unspent_coins = self.get_unspent_coins()
|
unspent_coins = self.get_unspent_coins()
|
||||||
|
seed = self.decode_seed(password)
|
||||||
|
|
||||||
# convert private_keys to dict
|
# convert private_keys to dict
|
||||||
pk = {}
|
pk = {}
|
||||||
@@ -267,7 +269,6 @@ class Wallet:
|
|||||||
raise
|
raise
|
||||||
|
|
||||||
# find the address:
|
# find the address:
|
||||||
import deserialize
|
|
||||||
if txin.get('electrumKeyID'):
|
if txin.get('electrumKeyID'):
|
||||||
n, for_change = txin.get('electrumKeyID')
|
n, for_change = txin.get('electrumKeyID')
|
||||||
sec = self.sequence.get_private_key(n, for_change, seed)
|
sec = self.sequence.get_private_key(n, for_change, seed)
|
||||||
@@ -279,8 +280,9 @@ class Wallet:
|
|||||||
txin['address'] = hash_160_to_bc_address(hash_160(txin.get("redeemScript").decode('hex')), 5)
|
txin['address'] = hash_160_to_bc_address(hash_160(txin.get("redeemScript").decode('hex')), 5)
|
||||||
|
|
||||||
elif txin.get("raw_output_script"):
|
elif txin.get("raw_output_script"):
|
||||||
|
import deserialize
|
||||||
addr = deserialize.get_address_from_output_script(txin.get("raw_output_script").decode('hex'))
|
addr = deserialize.get_address_from_output_script(txin.get("raw_output_script").decode('hex'))
|
||||||
sec = self.get_private_key(addr, self.password)
|
sec = self.get_private_key(addr, password)
|
||||||
if sec:
|
if sec:
|
||||||
private_keys[addr] = sec
|
private_keys[addr] = sec
|
||||||
txin['address'] = addr
|
txin['address'] = addr
|
||||||
|
|||||||
Reference in New Issue
Block a user