add_hw_info only if a hw wallet is there. that should fix #1995
This commit is contained in:
parent
1e908bbf37
commit
92d2395e3d
|
@ -49,7 +49,7 @@ from util import NotEnoughFunds, PrintError, UserCancelled, profiler
|
||||||
|
|
||||||
from bitcoin import *
|
from bitcoin import *
|
||||||
from version import *
|
from version import *
|
||||||
from keystore import load_keystore
|
from keystore import load_keystore, Hardware_KeyStore
|
||||||
from storage import multisig_type
|
from storage import multisig_type
|
||||||
|
|
||||||
from transaction import Transaction
|
from transaction import Transaction
|
||||||
|
@ -1066,15 +1066,11 @@ class Abstract_Wallet(PrintError):
|
||||||
tx = Transaction(self.network.synchronous_get(request))
|
tx = Transaction(self.network.synchronous_get(request))
|
||||||
return tx
|
return tx
|
||||||
|
|
||||||
def sign_transaction(self, tx, password):
|
def add_hw_info(self, tx):
|
||||||
if self.is_watching_only():
|
|
||||||
return
|
|
||||||
|
|
||||||
# add previous tx for hw wallets
|
# add previous tx for hw wallets
|
||||||
for txin in tx.inputs():
|
for txin in tx.inputs():
|
||||||
tx_hash = txin['prevout_hash']
|
tx_hash = txin['prevout_hash']
|
||||||
txin['prev_tx'] = self.get_input_tx(tx_hash)
|
txin['prev_tx'] = self.get_input_tx(tx_hash)
|
||||||
|
|
||||||
# add output info for hw wallets
|
# add output info for hw wallets
|
||||||
info = {}
|
info = {}
|
||||||
xpubs = self.get_master_public_keys()
|
xpubs = self.get_master_public_keys()
|
||||||
|
@ -1088,6 +1084,12 @@ class Abstract_Wallet(PrintError):
|
||||||
info[addr] = index, sorted_xpubs, self.m if isinstance(self, Multisig_Wallet) else None
|
info[addr] = index, sorted_xpubs, self.m if isinstance(self, Multisig_Wallet) else None
|
||||||
tx.output_info = info
|
tx.output_info = info
|
||||||
|
|
||||||
|
def sign_transaction(self, tx, password):
|
||||||
|
if self.is_watching_only():
|
||||||
|
return
|
||||||
|
# hardware wallets require extra info
|
||||||
|
if any([(isinstance(k, Hardware_KeyStore) and k.can_sign(tx)) for k in self.get_keystores()]):
|
||||||
|
self.add_hw_info(tx)
|
||||||
# sign
|
# sign
|
||||||
for k in self.get_keystores():
|
for k in self.get_keystores():
|
||||||
try:
|
try:
|
||||||
|
|
Loading…
Reference in New Issue