Skip to content

Commit 3e89e59

Browse files
committed
splice: Prevent user from signing an unfinal splice
An extra check to ensure the user doesn’t try to sign a splice that wasn’t finalized.
1 parent 390878c commit 3e89e59

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

channeld/channeld.c

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4265,6 +4265,15 @@ static void splice_initiator_user_signed(struct peer *peer, const u8 *inmsg)
42654265
wire_sync_write(MASTER_FD, take(msg));
42664266
return;
42674267
}
4268+
if (!inflight) {
4269+
msg = towire_channeld_splice_state_error(NULL, "Can't sign a"
4270+
" splice until the"
4271+
" splice is finalized"
4272+
" using"
4273+
" splice_update");
4274+
wire_sync_write(MASTER_FD, take(msg));
4275+
return;
4276+
}
42684277

42694278
if (!fromwire_channeld_splice_signed(inflight, inmsg, &signed_psbt,
42704279
&peer->splicing->force_sign_first))

0 commit comments

Comments
 (0)