| 2550 | } |
| 2551 | |
| 2552 | static void handle_peer_start_batch(struct peer *peer, const u8 *msg) |
| 2553 | { |
| 2554 | u16 batch_size; |
| 2555 | struct channel_id channel_id; |
| 2556 | struct tlv_start_batch_tlvs *tlvs; |
| 2557 | if (!fromwire_start_batch(tmpctx, msg, &channel_id, &batch_size, &tlvs)) |
| 2558 | peer_failed_warn(peer->pps, &peer->channel_id, |
| 2559 | "Bad start_batch %s", tal_hex(msg, msg)); |
| 2560 | |
| 2561 | if (!tlvs || !tlvs->batch_info |
| 2562 | || *tlvs->batch_info != WIRE_COMMITMENT_SIGNED) { |
| 2563 | status_unusual("Ignoring Unrecognized start_batch message type" |
| 2564 | " %s, expected WIRE_COMMITMENT_SIGNED.", |
| 2565 | tlvs && tlvs->batch_info |
| 2566 | ? peer_wire_name(*tlvs->batch_info) |
| 2567 | : "N/A"); |
| 2568 | return; |
| 2569 | } |
| 2570 | |
| 2571 | /* Bolt #2 |
| 2572 | * A sending node: |
| 2573 | * - MUST set batch_size to a value strictly greater than 1. |
| 2574 | */ |
| 2575 | if (batch_size < 2) { |
| 2576 | peer_failed_warn(peer->pps, &peer->channel_id, |
| 2577 | "Don't send a start_batch with batch size" |
| 2578 | "below 2"); |
| 2579 | } |
| 2580 | |
| 2581 | handle_peer_commit_sig_batch(peer, peer_read(tmpctx, peer->pps), |
| 2582 | peer->channel->funding_pubkey[REMOTE], |
| 2583 | NULL, 0, 0, |
| 2584 | peer->next_index[LOCAL], |
| 2585 | &peer->next_local_per_commit, |
| 2586 | false, |
| 2587 | batch_size); |
| 2588 | } |
| 2589 | |
| 2590 | |
| 2591 | /* Pops the penalty base for the given commitnum from our internal list. There |
no test coverage detected