from bit.transaction import select_coins
# Should raise InsufficientFunds
s = select_coins(10000, 1, [42], 100, unspents=[])
UnboundLocalError: cannot access local variable 'estimated_fee' where it is not associated with a value
The PR proposes to initialize the estimated_fee integer right before the while condition.
https://github.com/ofek/bit/blob/d351d1d819abfdb973411b4c8855d784ab58046c/bit/transaction.py#L316-L329 estimated_fee integer is initialized within the
while
block of select_coins, resulting inUnboundLocalError
in the case when an empty container is provided for theunspents
argument.The PR proposes to initialize the
estimated_fee
integer right before the while condition.