From 8c87dd3aa48455fa68b38992e4de2f5391e9aa99 Mon Sep 17 00:00:00 2001 From: Christian Decker Date: Thu, 7 Feb 2019 15:40:28 +0100 Subject: [PATCH] wire: derive_channel_id should accept const struct *bitcoin_txid It's not modifying anything in the txid itself, just mashing it up with the txout index. Signed-off-by: Christian Decker --- wire/fromwire.c | 2 +- wire/wire.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/wire/fromwire.c b/wire/fromwire.c index 28c6ac70a..c5e435945 100644 --- a/wire/fromwire.c +++ b/wire/fromwire.c @@ -253,7 +253,7 @@ REGISTER_TYPE_TO_HEXSTR(channel_id); * (i.e. `funding_output_index` alters the last 2 bytes). */ void derive_channel_id(struct channel_id *channel_id, - struct bitcoin_txid *txid, u16 txout) + const struct bitcoin_txid *txid, u16 txout) { BUILD_ASSERT(sizeof(*channel_id) == sizeof(*txid)); memcpy(channel_id, txid, sizeof(*channel_id)); diff --git a/wire/wire.h b/wire/wire.h index c3eaed7d8..4b038dbe3 100644 --- a/wire/wire.h +++ b/wire/wire.h @@ -30,7 +30,7 @@ struct siphash_seed; typedef char wirestring; void derive_channel_id(struct channel_id *channel_id, - struct bitcoin_txid *txid, u16 txout); + const struct bitcoin_txid *txid, u16 txout); /* Read the type; returns -1 if not long enough. cursor is a tal ptr. */ int fromwire_peektype(const u8 *cursor);