1
0

wallet: make sure we don't create zero input txs

fixes #7207
This commit is contained in:
SomberNight
2021-04-14 19:08:04 +02:00
parent 7335a584e7
commit 67c6f0e1bd
3 changed files with 31 additions and 1 deletions

View File

@@ -307,6 +307,10 @@ class CoinChooserBase(Logger):
total_input = input_value + bucket_value_sum
if total_input < spent_amount: # shortcut for performance
return False
# any bitcoin tx must have at least 1 input by consensus
# (check we add some new UTXOs now or already have some fixed inputs)
if not buckets and not inputs:
return False
# note re performance: so far this was constant time
# what follows is linear in len(buckets)
total_weight = self._get_tx_weight(buckets, base_weight=base_weight)