Skip to content

Commit 6c1d4e4

Browse files
committed
Workaround for 1.4.0 TX parser regression
1 parent 9ec21ec commit 6c1d4e4

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

btchip/__init__.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,5 +16,5 @@
1616
* limitations under the License.
1717
********************************************************************************
1818
"""
19-
__version__ = "0.1.29"
19+
__version__ = "0.1.30"
2020

btchip/btchip.py

+4-2
Original file line numberDiff line numberDiff line change
@@ -242,8 +242,6 @@ def startUntrustedTransaction(self, newTransaction, inputIndex, outputList, rede
242242
if currentIndex != inputIndex:
243243
script = bytearray()
244244
writeVarint(len(script), params)
245-
if len(script) == 0:
246-
params.extend(sequence)
247245
apdu.append(len(params))
248246
apdu.extend(params)
249247
self.dongle.exchange(bytearray(apdu))
@@ -261,6 +259,10 @@ def startUntrustedTransaction(self, newTransaction, inputIndex, outputList, rede
261259
apdu.extend(params)
262260
self.dongle.exchange(bytearray(apdu))
263261
offset += blockLength
262+
if len(script) == 0:
263+
apdu = [ self.BTCHIP_CLA, self.BTCHIP_INS_HASH_INPUT_START, 0x80, 0x00, len(sequence) ]
264+
apdu.extend(sequence)
265+
self.dongle.exchange(bytearray(apdu))
264266
currentIndex += 1
265267

266268
def finalizeInput(self, outputAddress, amount, fees, changePath, rawTx=None):

0 commit comments

Comments
 (0)