Skip to content

Commit

Permalink
wire: derive_channel_id should accept const struct *bitcoin_txid
Browse files Browse the repository at this point in the history
It's not modifying anything in the txid itself, just mashing it up
with the txout index.

Signed-off-by: Christian Decker <[email protected]>
  • Loading branch information
cdecker committed Feb 20, 2019
1 parent ca3db29 commit bccb8db
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion wire/fromwire.c
Original file line number Diff line number Diff line change
Expand Up @@ -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));
Expand Down
2 changes: 1 addition & 1 deletion wire/wire.h
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit bccb8db

Please sign in to comment.