@@ -2251,16 +2251,28 @@ static int commit_cmp(const void *a, const void *n, void *peer)
22512251 int commit_index_a = commit_index_from_msg (* (u8 * * )a , peer );
22522252 int commit_index_n = commit_index_from_msg (* (u8 * * )n , peer );
22532253
2254- if (commit_index_a == commit_index_n )
2254+ status_debug ("commit_cmp a: %p, n: %p result: %d & %d" ,
2255+ * (u8 * * )a , * (u8 * * )n , commit_index_a , commit_index_n );
2256+
2257+ if (commit_index_a == commit_index_n ) {
2258+ status_debug ("commit_cmp: return 0" );
22552259 return 0 ;
2260+ }
22562261
22572262 /* Unrecognized commits go on the end */
2258- if (commit_index_a == -1 )
2263+ if (commit_index_a == -1 ) {
2264+ status_debug ("commit_cmp: return 1" );
22592265 return 1 ;
2266+ }
22602267
2261- if (commit_index_n == -1 )
2268+ if (commit_index_n == -1 ) {
2269+ status_debug ("commit_cmp: return -1" );
22622270 return -1 ;
2271+ }
22632272
2273+ status_debug ("commit_cmp: return %d - %d = %d" ,
2274+ commit_index_a , commit_index_n ,
2275+ commit_index_a - commit_index_n );
22642276 /* Otherwise we sort by commit_index */
22652277 return commit_index_a - commit_index_n ;
22662278}
@@ -2298,7 +2310,7 @@ static struct commitsig_info *handle_peer_commit_sig_batch(struct peer *peer,
22982310
22992311 msg_batch = tal_arr (tmpctx , const u8 * , batch_size );
23002312 msg_batch [0 ] = msg ;
2301- status_info ("msg_batch[0]: %p" , msg_batch [0 ]);
2313+ status_debug ("msg_batch[0]: %p" , msg_batch [0 ]);
23022314
23032315 /* Already received commitment signed once, so start at i = 1 */
23042316 for (u16 i = 1 ; i < batch_size ; i ++ ) {
@@ -2314,7 +2326,7 @@ static struct commitsig_info *handle_peer_commit_sig_batch(struct peer *peer,
23142326 "Expected splice related "
23152327 "WIRE_COMMITMENT_SIGNED but got %s" ,
23162328 peer_wire_name (type ));
2317- status_info ("fromwire_commitment_signed(%p) splice index %d" , sub_msg , (int )i );
2329+ status_debug ("fromwire_commitment_signed(%p) splice index %d" , sub_msg , (int )i );
23182330 if (!fromwire_commitment_signed (tmpctx , sub_msg ,
23192331 & channel_id , & commit_sig .s ,
23202332 & raw_sigs , & sub_cs_tlv ))
@@ -2333,10 +2345,10 @@ static struct commitsig_info *handle_peer_commit_sig_batch(struct peer *peer,
23332345 tal_hex (sub_msg , sub_msg ));
23342346
23352347 msg_batch [i ] = sub_msg ;
2336- status_info ("msg_batch[%d]: %p" , (int )i , msg_batch [i ]);
2348+ status_debug ("msg_batch[%d]: %p" , (int )i , msg_batch [i ]);
23372349 }
23382350
2339- status_info ("Sorting the msg_batch of tal_count %d, batch_size: %d" , (int )tal_count (msg_batch ), (int )batch_size );
2351+ status_debug ("Sorting the msg_batch of tal_count %d, batch_size: %d" , (int )tal_count (msg_batch ), (int )batch_size );
23402352 asort (msg_batch , tal_count (msg_batch ), commit_cmp , peer );
23412353
23422354 return handle_peer_commit_sig (peer , msg , commit_index , remote_funding ,
0 commit comments