@@ -325,15 +325,15 @@ def find_transfer_inputs(fromaddr, coloraddress, coloramt, btc):
325
325
btcavailable = btcavailable + x [0 ]
326
326
if totalavailable >= coloramt and btcavailable >= btc :
327
327
n = 0
328
- while totalfound < coloramt :
328
+ while totalfound < coloramt and n < len ( available_inputs ) :
329
329
r = {}
330
330
r ['output' ]= available_inputs [n ][7 ]
331
331
r ['value' ]= available_inputs [n ][0 ]
332
332
btcfound = btcfound + r ['value' ]
333
333
answer .append (r )
334
334
n = n + 1
335
335
336
- while btcfound < btc :
336
+ while btcfound < btc and n < len ( available_inputs ) :
337
337
r = {}
338
338
if n < len (available_inputs ):
339
339
r ['output' ]= available_inputs [n ][7 ]
@@ -346,7 +346,8 @@ def find_transfer_inputs(fromaddr, coloraddress, coloramt, btc):
346
346
def transfer_tx (fromaddr , dest , fee , privatekey , coloraddress , coloramt , othermeta ):
347
347
btcneeded = fee + dust * 4
348
348
inputs = find_transfer_inputs (fromaddr , coloraddress , coloramt , btcneeded )
349
- result = create_transfer_tx (fromaddr , dest , fee , privatekey , coloramt , )
349
+ inputcoloramt =
350
+ result = create_transfer_tx (fromaddr , dest , fee , privatekey , coloramt , inputs , inputcoloramt , othermeta )
350
351
return result
351
352
352
353
def formation_message (colornumber , colorname , ticker , description ):
0 commit comments