make coin selection a bit faster
This commit is contained in:
parent
65e7dca3de
commit
dd8493f97e
|
@ -863,8 +863,12 @@ class Abstract_Wallet(object):
|
||||||
total += v
|
total += v
|
||||||
self.add_input_info(item)
|
self.add_input_info(item)
|
||||||
tx.add_input(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)
|
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:
|
else:
|
||||||
raise NotEnoughFunds()
|
raise NotEnoughFunds()
|
||||||
# remove unneeded inputs
|
# remove unneeded inputs
|
||||||
|
|
Loading…
Reference in New Issue