make coin selection a bit faster

This commit is contained in:
ThomasV 2015-05-27 11:07:57 +02:00
parent 65e7dca3de
commit dd8493f97e
1 changed files with 5 additions and 1 deletions

View File

@ -863,8 +863,12 @@ class Abstract_Wallet(object):
total += v
self.add_input_info(item)
tx.add_input(item)
# no need to estimate fee until we have reached desired amount
if total < amount:
continue
fee = fixed_fee if fixed_fee is not None else self.estimated_fee(tx)
if total >= amount + fee: break
if total >= amount + fee:
break
else:
raise NotEnoughFunds()
# remove unneeded inputs