From 57ce862532270f4da022243ed706ec09916daa45 Mon Sep 17 00:00:00 2001 From: Dusty Daemon Date: Thu, 15 Feb 2024 13:03:04 -0500 Subject: [PATCH] splice: Abort on insufficent funds MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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. --- channeld/channeld.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/channeld/channeld.c b/channeld/channeld.c index d5451b3fad91..53f4aa3e2ec2 100644 --- a/channeld/channeld.c +++ b/channeld/channeld.c @@ -3028,20 +3028,20 @@ static struct amount_sat check_balances(struct peer *peer, * While we're, here, adjust the output counts by splice amount. */ 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"); + peer->splicing->opener_relative)) + 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->splicing->opener_relative)) peer_failed_warn(peer->pps, &peer->channel_id, "Unable to add opener funding to out amnt."); 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"); + peer->splicing->accepter_relative)) + 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->splicing->accepter_relative)) peer_failed_warn(peer->pps, &peer->channel_id, "Unable to add accepter funding to out amnt.");