@@ -444,8 +444,20 @@ static void check_mutual_splice_locked(struct peer *peer)
444
444
445
445
if (short_channel_id_eq (peer -> short_channel_ids [LOCAL ],
446
446
peer -> splice_state -> short_channel_id ))
447
- peer_failed_warn (peer -> pps , & peer -> channel_id ,
448
- "Duplicate splice_locked events detected" );
447
+ peer_failed_err (peer -> pps , & peer -> channel_id ,
448
+ "Duplicate splice_locked events detected"
449
+ " by scid check" );
450
+
451
+ if (!peer -> splice_state -> remote_locked_txid
452
+ || !bitcoin_txid_eq (peer -> splice_state -> remote_locked_txid ,
453
+ & peer -> splice_state -> locked_txid ))
454
+ peer_failed_err (peer -> pps , & peer -> channel_id ,
455
+ "splice_locked message txid %s does not match"
456
+ " our locked txid %s" ,
457
+ fmt_bitcoin_txid (tmpctx ,
458
+ peer -> splice_state -> remote_locked_txid ),
459
+ fmt_bitcoin_txid (tmpctx ,
460
+ & peer -> splice_state -> locked_txid ));
449
461
450
462
peer -> splice_state -> await_commitment_succcess = true;
451
463
@@ -473,7 +485,7 @@ static void check_mutual_splice_locked(struct peer *peer)
473
485
inflight = peer -> splice_state -> inflights [i ];
474
486
475
487
if (!inflight )
476
- peer_failed_warn (peer -> pps , & peer -> channel_id ,
488
+ peer_failed_err (peer -> pps , & peer -> channel_id ,
477
489
"Unable to find inflight txid amoung %zu"
478
490
" inflights. new funding txid: %s" ,
479
491
tal_count (peer -> splice_state -> inflights ),
@@ -487,7 +499,7 @@ static void check_mutual_splice_locked(struct peer *peer)
487
499
inflight -> amnt ,
488
500
inflight -> splice_amnt );
489
501
if (error )
490
- peer_failed_warn (peer -> pps , & peer -> channel_id ,
502
+ peer_failed_err (peer -> pps , & peer -> channel_id ,
491
503
"Splice lock unable to update funding. %s" ,
492
504
error );
493
505
@@ -508,6 +520,7 @@ static void check_mutual_splice_locked(struct peer *peer)
508
520
509
521
peer -> splice_state -> inflights = tal_free (peer -> splice_state -> inflights );
510
522
peer -> splice_state -> count = 0 ;
523
+ peer -> splice_state -> remote_locked_txid = tal_free (peer -> splice_state -> remote_locked_txid );
511
524
}
512
525
513
526
/* Our peer told us they saw our splice confirm on chain with `splice_locked`.
@@ -522,6 +535,16 @@ static void handle_peer_splice_locked(struct peer *peer, const u8 *msg)
522
535
peer_failed_warn (peer -> pps , & peer -> channel_id ,
523
536
"Bad splice_locked %s" , tal_hex (msg , msg ));
524
537
538
+ if (peer -> splice_state -> remote_locked_txid )
539
+ peer_failed_err (peer -> pps , & chanid ,
540
+ "Peer sent duplicate splice_locked message %s" ,
541
+ tal_hex (tmpctx , msg ));
542
+
543
+ peer -> splice_state -> remote_locked_txid = tal (peer -> splice_state ,
544
+ struct bitcoin_txid );
545
+
546
+ * peer -> splice_state -> remote_locked_txid = splice_txid ;
547
+
525
548
if (!channel_id_eq (& chanid , & peer -> channel_id ))
526
549
peer_failed_err (peer -> pps , & chanid ,
527
550
"Wrong splice lock channel id in %s "
0 commit comments