Skip to content

Commit

Permalink
Fix local variable 'btc_out' referenced before assignment error
Browse files Browse the repository at this point in the history
  • Loading branch information
JahPowerBit committed Jan 11, 2015
1 parent b3108cd commit 33e527b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/transaction.py
Original file line number Diff line number Diff line change
Expand Up @@ -404,6 +404,7 @@ def construct (db, proxy, tx_info, encoding='auto',

inputs = []
btc_in = 0
btc_out = destination_btc_out + data_btc_out
change_quantity = 0
sufficient_funds = False
final_fee = fee_per_kb
Expand All @@ -423,7 +424,6 @@ def construct (db, proxy, tx_info, encoding='auto',
assert final_fee >= 1 * fee_per_kb

# Check if good.
btc_out = destination_btc_out + data_btc_out
change_quantity = btc_in - (btc_out + final_fee)
logger.debug('Change quantity: {} BTC'.format(change_quantity / config.UNIT))
# If change is necessary, must not be a dust output.
Expand Down

0 comments on commit 33e527b

Please sign in to comment.