@@ -219,6 +219,10 @@ def startUntrustedTransaction(self, newTransaction, inputIndex, outputList, rede
219219 # Loop for each input
220220 currentIndex = 0
221221 for passedOutput in outputList :
222+ if ('sequence' in passedOutput ) and passedOutput ['sequence' ]:
223+ sequence = bytearray (passedOutput ['sequence' ].decode ('hex' ))
224+ else :
225+ sequence = bytearray ([0xFF , 0xFF , 0xFF , 0xFF ]) # default sequence
222226 apdu = [ self .BTCHIP_CLA , self .BTCHIP_INS_HASH_INPUT_START , 0x80 , 0x00 ]
223227 params = []
224228 script = redeemScript
@@ -235,7 +239,7 @@ def startUntrustedTransaction(self, newTransaction, inputIndex, outputList, rede
235239 script = bytearray ()
236240 writeVarint (len (script ), params )
237241 if len (script ) == 0 :
238- params .extend (bytearray ([ 0xFF , 0xFF , 0xFF , 0xFF ])) # default sequence
242+ params .extend (sequence )
239243 apdu .append (len (params ))
240244 apdu .extend (params )
241245 self .dongle .exchange (bytearray (apdu ))
@@ -248,7 +252,7 @@ def startUntrustedTransaction(self, newTransaction, inputIndex, outputList, rede
248252 dataLength = len (script ) - offset
249253 params = script [offset : offset + dataLength ]
250254 if ((offset + dataLength ) == len (script )):
251- params .extend (bytearray ([ 0xFF , 0xFF , 0xFF , 0xFF ])) # default sequence
255+ params .extend (sequence )
252256 apdu = [ self .BTCHIP_CLA , self .BTCHIP_INS_HASH_INPUT_START , 0x80 , 0x00 , len (params ) ]
253257 apdu .extend (params )
254258 self .dongle .exchange (bytearray (apdu ))
0 commit comments