common/read_peer_msg: don't try to handle reestablish/reopen.

Let the callers do that (only channeld needs to do this).

We temporarily send an error on unknown reestablish in openingd, as
this mimic previous behavior and avoids breaking tests (it does leave
a BROKEN message in the logs though, so
test_funding_external_wallet_corners needs to ignore that for now.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This commit is contained in:
Rusty Russell
2021-06-15 06:39:51 +09:30
parent ef138575e1
commit b223a6acbb
5 changed files with 28 additions and 23 deletions

View File

@@ -1170,12 +1170,21 @@ static u8 *handle_peer_in(struct state *state)
&state->channel_id, false, msg))
return NULL;
sync_crypto_write(state->pps,
take(towire_warningfmt(NULL,
extract_channel_id(msg, &channel_id) ? &channel_id : NULL,
"Unexpected message %s: %s",
peer_wire_name(t),
tal_hex(tmpctx, msg))));
if (extract_channel_id(msg, &channel_id)) {
sync_crypto_write(state->pps,
take(towire_errorfmt(NULL,
&channel_id,
"Unexpected message %s: %s",
peer_wire_name(t),
tal_hex(tmpctx, msg))));
} else {
sync_crypto_write(state->pps,
take(towire_warningfmt(NULL,
NULL,
"Unexpected message %s: %s",
peer_wire_name(t),
tal_hex(tmpctx, msg))));
}
/* FIXME: We don't actually want master to try to send an
* error, since peer is transient. This is a hack.