Skip to content

Commit

Permalink
splice: Abort on insufficent funds
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
ddustin committed Feb 15, 2024
1 parent 141cdc0 commit 57ce862
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions channeld/channeld.c
Original file line number Diff line number Diff line change
Expand Up @@ -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.");

Expand Down

0 comments on commit 57ce862

Please sign in to comment.