common: generalize extract_channel_id().

connectd is going to end up using this do demux; make it fast and complete.

Fixing this reveals a problem in openingd: it now extracts the channel_id
from funding_signed (which is where we transition off the temporary), and
gets upset.  So fix that.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This commit is contained in:
Rusty Russell
2021-12-28 09:54:09 +10:30
parent 5111f39d2a
commit 35e3c1866e
26 changed files with 264 additions and 60 deletions

View File

@@ -103,6 +103,9 @@ bool is_peer_error(const tal_t *ctx, const u8 *msg,
bool is_wrong_channel(const u8 *msg, const struct channel_id *expected,
struct channel_id *actual)
{
if (!expected)
return false;
if (!extract_channel_id(msg, actual))
return false;