Skip to content

Commit 475d5f8

Browse files
ddustinrustyrussell
authored andcommitted
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.
1 parent 14b63d8 commit 475d5f8

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

channeld/channeld.c

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2969,20 +2969,20 @@ static struct amount_sat check_balances(struct peer *peer,
29692969
* While we're, here, adjust the output counts by splice amount.
29702970
*/
29712971
if (!amount_msat_add_sat_s64(&funding_amount, funding_amount,
2972-
peer->splicing->opener_relative))
2973-
peer_failed_warn(peer->pps, &peer->channel_id,
2974-
"Unable to add opener funding");
2972+
peer->splicing->opener_relative))
2973+
splice_abort(peer, "Splice initiator did not provide enough"
2974+
" funding");
29752975
if (!amount_msat_add_sat_s64(&out[TX_INITIATOR], out[TX_INITIATOR],
2976-
peer->splicing->opener_relative))
2976+
peer->splicing->opener_relative))
29772977
peer_failed_warn(peer->pps, &peer->channel_id,
29782978
"Unable to add opener funding to out amnt.");
29792979

29802980
if (!amount_msat_add_sat_s64(&funding_amount, funding_amount,
2981-
peer->splicing->accepter_relative))
2982-
peer_failed_warn(peer->pps, &peer->channel_id,
2983-
"Unable to add accepter funding");
2981+
peer->splicing->accepter_relative))
2982+
splice_abort(peer, "Splice accepter did not provide enough"
2983+
" funding");
29842984
if (!amount_msat_add_sat_s64(&out[TX_ACCEPTER], out[TX_ACCEPTER],
2985-
peer->splicing->accepter_relative))
2985+
peer->splicing->accepter_relative))
29862986
peer_failed_warn(peer->pps, &peer->channel_id,
29872987
"Unable to add accepter funding to out amnt.");
29882988

0 commit comments

Comments
 (0)