@@ -2253,16 +2253,28 @@ static int commit_cmp(const void *a, const void *n, void *peer)
22532253 int commit_index_a = commit_index_from_msg (* (u8 * * )a , peer );
22542254 int commit_index_n = commit_index_from_msg (* (u8 * * )n , peer );
22552255
2256- if (commit_index_a == commit_index_n )
2256+ status_debug ("commit_cmp a: %p, n: %p result: %d & %d" ,
2257+ * (u8 * * )a , * (u8 * * )n , commit_index_a , commit_index_n );
2258+
2259+ if (commit_index_a == commit_index_n ) {
2260+ status_debug ("commit_cmp: return 0" );
22572261 return 0 ;
2262+ }
22582263
22592264 /* Unrecognized commits go on the end */
2260- if (commit_index_a == -1 )
2265+ if (commit_index_a == -1 ) {
2266+ status_debug ("commit_cmp: return 1" );
22612267 return 1 ;
2268+ }
22622269
2263- if (commit_index_n == -1 )
2270+ if (commit_index_n == -1 ) {
2271+ status_debug ("commit_cmp: return -1" );
22642272 return -1 ;
2273+ }
22652274
2275+ status_debug ("commit_cmp: return %d - %d = %d" ,
2276+ commit_index_a , commit_index_n ,
2277+ commit_index_a - commit_index_n );
22662278 /* Otherwise we sort by commit_index */
22672279 return commit_index_a - commit_index_n ;
22682280}
@@ -2300,7 +2312,7 @@ static struct commitsig_info *handle_peer_commit_sig_batch(struct peer *peer,
23002312
23012313 msg_batch = tal_arr (tmpctx , const u8 * , batch_size );
23022314 msg_batch [0 ] = msg ;
2303- status_info ("msg_batch[0]: %p" , msg_batch [0 ]);
2315+ status_debug ("msg_batch[0]: %p" , msg_batch [0 ]);
23042316
23052317 /* Already received commitment signed once, so start at i = 1 */
23062318 for (u16 i = 1 ; i < batch_size ; i ++ ) {
@@ -2316,7 +2328,7 @@ static struct commitsig_info *handle_peer_commit_sig_batch(struct peer *peer,
23162328 "Expected splice related "
23172329 "WIRE_COMMITMENT_SIGNED but got %s" ,
23182330 peer_wire_name (type ));
2319- status_info ("fromwire_commitment_signed(%p) splice index %d" , sub_msg , (int )i );
2331+ status_debug ("fromwire_commitment_signed(%p) splice index %d" , sub_msg , (int )i );
23202332 if (!fromwire_commitment_signed (tmpctx , sub_msg ,
23212333 & channel_id , & commit_sig .s ,
23222334 & raw_sigs , & sub_cs_tlv ))
@@ -2335,10 +2347,10 @@ static struct commitsig_info *handle_peer_commit_sig_batch(struct peer *peer,
23352347 tal_hex (sub_msg , sub_msg ));
23362348
23372349 msg_batch [i ] = sub_msg ;
2338- status_info ("msg_batch[%d]: %p" , (int )i , msg_batch [i ]);
2350+ status_debug ("msg_batch[%d]: %p" , (int )i , msg_batch [i ]);
23392351 }
23402352
2341- status_info ("Sorting the msg_batch of tal_count %d, batch_size: %d" , (int )tal_count (msg_batch ), (int )batch_size );
2353+ status_debug ("Sorting the msg_batch of tal_count %d, batch_size: %d" , (int )tal_count (msg_batch ), (int )batch_size );
23422354 asort (msg_batch , tal_count (msg_batch ), commit_cmp , peer );
23432355
23442356 return handle_peer_commit_sig (peer , msg , commit_index , remote_funding ,
0 commit comments