mirror of
https://github.com/aljazceru/lightning.git
synced 2026-01-04 06:44:24 +01:00
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:
@@ -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.
|
||||
|
||||
Reference in New Issue
Block a user