splice: Abort on insufficent funds

If the user does not supply enough funds treat it as an abort instead of a channel warning.

Also clean up some indentation while we’re there.
This commit is contained in:
Dusty Daemon 2024-11-11 13:20:42 +10:30 committed by Rusty Russell
parent 14b63d8927
commit 475d5f8bf9

View File

@ -2970,8 +2970,8 @@ static struct amount_sat check_balances(struct peer *peer,
*/
if (!amount_msat_add_sat_s64(&funding_amount, funding_amount,
peer->splicing->opener_relative))
peer_failed_warn(peer->pps, &peer->channel_id,
"Unable to add opener funding");
splice_abort(peer, "Splice initiator did not provide enough"
" funding");
if (!amount_msat_add_sat_s64(&out[TX_INITIATOR], out[TX_INITIATOR],
peer->splicing->opener_relative))
peer_failed_warn(peer->pps, &peer->channel_id,
@ -2979,8 +2979,8 @@ static struct amount_sat check_balances(struct peer *peer,
if (!amount_msat_add_sat_s64(&funding_amount, funding_amount,
peer->splicing->accepter_relative))
peer_failed_warn(peer->pps, &peer->channel_id,
"Unable to add accepter funding");
splice_abort(peer, "Splice accepter did not provide enough"
" funding");
if (!amount_msat_add_sat_s64(&out[TX_ACCEPTER], out[TX_ACCEPTER],
peer->splicing->accepter_relative))
peer_failed_warn(peer->pps, &peer->channel_id,