Python 3 and Segwit fixes
This commit is contained in:
@@ -1,4 +1,3 @@
|
||||
from binascii import hexlify
|
||||
from struct import pack, unpack
|
||||
import hashlib
|
||||
import time
|
||||
@@ -175,8 +174,8 @@ class Ledger_KeyStore(Hardware_KeyStore):
|
||||
self.cfg = d.get('cfg', {'mode':0,'pair':''})
|
||||
|
||||
def is_segwit(self):
|
||||
return self.plugin.segwit
|
||||
|
||||
return self.derivation.startswith("m/49'/")
|
||||
|
||||
def dump(self):
|
||||
obj = Hardware_KeyStore.dump(self)
|
||||
obj['cfg'] = self.cfg
|
||||
@@ -341,10 +340,10 @@ class Ledger_KeyStore(Hardware_KeyStore):
|
||||
for utxo in inputs:
|
||||
sequence = int_to_hex(utxo[5], 4)
|
||||
if segwitTransaction:
|
||||
txtmp = bitcoinTransaction(bfh(utxo[0]))
|
||||
txtmp = bitcoinTransaction(bfh(utxo[0]))
|
||||
tmp = bfh(utxo[3])[::-1]
|
||||
tmp += bfh(int_to_hex(utxo[1], 4))
|
||||
tmp += str(txtmp.outputs[utxo[1]].amount)
|
||||
tmp += txtmp.outputs[utxo[1]].amount
|
||||
chipInputs.append({'value' : tmp, 'witness' : True, 'sequence' : sequence})
|
||||
redeemScripts.append(bfh(utxo[2]))
|
||||
elif not p2shTransaction:
|
||||
|
||||
Reference in New Issue
Block a user