pytest: fix broken message in test_even_sendcustommsg.

We can stop listening on the incoming peer while we are closing, so we don't notice if they close:

```
['lightningd-2 2025-09-03T09:48:19.555Z **BROKEN** 0266e4598d1d3c415f572a8488830b60f7e744ed9235eb0b1ba93283b315c03518-connectd: Peer did not close, forcing close', 'lightningd-2 2025-09-03T09:48:22.918Z **BROKEN** 0266e4598d1d3c415f572a8488830b60f7e744ed9235eb0b1ba93283b315c03518-connectd: Peer did not close, forcing close']
=========================== short test summary info ============================
ERROR tests/test_misc.py::test_even_sendcustommsg - ValueError:
```

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This commit is contained in:
Rusty Russell
2025-09-30 11:33:27 +09:30
parent 3c3788a241
commit 7fed03b910

View File

@@ -1082,8 +1082,10 @@ static struct io_plan *write_to_peer(struct io_conn *peer_conn,
/* Still nothing to send? */
if (!msg) {
/* Draining? We're done when subds are done. */
if (peer->draining && tal_count(peer->subds) == 0)
if (peer->draining && tal_count(peer->subds) == 0) {
io_wake(&peer->peer_in);
return io_sock_shutdown(peer_conn);
}
/* If they want us to send gossip, do so now. */
if (!peer->draining)