Skip to content

Commit

Permalink
add correct handling for param fee in prepare_transaction when fee is 0
Browse files Browse the repository at this point in the history
+sanity check for fee type, should fix ofek#90
  • Loading branch information
ManFromSiberia committed Dec 6, 2019
1 parent b287ee9 commit d2ba17c
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion bit/wallet.py
Original file line number Diff line number Diff line change
Expand Up @@ -766,10 +766,12 @@ def prepare_transaction(cls, address, outputs, compressed=True, fee=None,
:returns: JSON storing data required to create an offline transaction.
:rtype: ``str``
"""
if not isinstance(fee, (int, type(None))):
raise TypeError('Invalid fee type.')
unspents, outputs = sanitize_tx_data(
unspents or NetworkAPI.get_unspent_testnet(address),
outputs,
fee or get_fee_cached(),
fee if isinstance(fee, int) else get_fee_cached(),
leftover or address,
combine=combine,
message=message,
Expand Down

0 comments on commit d2ba17c

Please sign in to comment.