1
0

serialize txin-type in xpub/xprv

This commit is contained in:
ThomasV
2017-10-25 17:33:49 +02:00
parent 62fe3a411b
commit a220932711
4 changed files with 21 additions and 23 deletions

View File

@@ -1662,14 +1662,7 @@ class Simple_Deterministic_Wallet(Simple_Wallet, Deterministic_Wallet):
xtype = deserialize_xpub(self.keystore.xpub)[0]
except:
xtype = 'standard'
if xtype == 'standard':
self.txin_type = 'p2pkh'
elif xtype == 'segwit':
self.txin_type = 'p2wpkh'
elif xtype == 'segwit_p2sh':
self.txin_type = 'p2wpkh-p2sh'
else:
raise BaseException('unknown txin_type', xtype)
self.txin_type = 'p2pkh' if xtype == 'standard' else xtype
def get_pubkey(self, c, i):
return self.derive_pubkeys(c, i)
@@ -1731,14 +1724,7 @@ class Multisig_Wallet(Deterministic_Wallet):
self.keystores[name] = load_keystore(self.storage, name)
self.keystore = self.keystores['x1/']
xtype = deserialize_xpub(self.keystore.xpub)[0]
if xtype == 'standard':
self.txin_type = 'p2sh'
elif xtype == 'segwit':
self.txin_type = 'p2wsh'
elif xtype == 'segwit_p2sh':
self.txin_type = 'p2wsh-p2sh'
else:
raise BaseException('unknown txin_type', xtype)
self.txin_type = 'p2sh' if xtype == 'standard' else 'xtype'
def save_keystore(self):
for name, k in self.keystores.items():