diff --git a/test/functional/test_framework/wallet.py b/test/functional/test_framework/wallet.py index 97c1a7a652e2e4..2c7b4dfdb95fad 100644 --- a/test/functional/test_framework/wallet.py +++ b/test/functional/test_framework/wallet.py @@ -384,7 +384,8 @@ def create_self_transfer( max_actual_weight = target_weight + BULK_TX_PADDING_OFFSET fee = get_fee(math.ceil(max_actual_weight / WITNESS_SCALE_FACTOR), fee_rate) send_value = utxo_to_spend["value"] - (fee or (fee_rate * vsize / 1000)) - + if send_value <= 0: + raise Exception(f"UTXO value {utxo_to_spend['value']} is too small to cover fees {(fee or (fee_rate * vsize / 1000))}") # create tx tx = self.create_self_transfer_multi( utxos_to_spend=[utxo_to_spend],