Skip to content

Commit

Permalink
fix for 'confirmed_only' setting glitch in BFP code
Browse files Browse the repository at this point in the history
* This bug is related to the SLP token sending in Issue spesmilo#28.
  • Loading branch information
jcramer committed Oct 9, 2018
1 parent 8755f91 commit 568a422
Showing 1 changed file with 10 additions and 9 deletions.
19 changes: 10 additions & 9 deletions lib/bitcoinfiles.py
Original file line number Diff line number Diff line change
Expand Up @@ -284,16 +284,17 @@ def getFundingTxn(wallet, address, amount, config):
domain = None
org_confirmed_only = config.get('confirmed_only', False)
config.set_key('confirmed_only', True)
assert config.get('confirmed_only', False) == True

coins = wallet.get_spendable_coins(domain, config)
fee = None
change_addr = None
tx = wallet.make_unsigned_transaction(coins, askedoutputs, config, fee, change_addr)

# Change key back to original setting
config.set_key('confirmed_only', org_confirmed_only)
assert config.get('confirmed_only', False) == org_confirmed_only
try:
coins = wallet.get_spendable_coins(domain, config)
fee = None
change_addr = None
tx = wallet.make_unsigned_transaction(coins, askedoutputs, config, fee, change_addr)
except util.NotEnoughFunds as e:
raise e
finally:
# Change 'confirmed_only' key back to original setting
config.set_key('confirmed_only', org_confirmed_only)

# unfortunately, the outputs might be in wrong order due to BIPLI01
# output sorting, so we remake it.
Expand Down

0 comments on commit 568a422

Please sign in to comment.